/* ===== RESET & BASE ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --amber: #D4870E;
    --amber-light: #F5A623;
    --amber-glow: rgba(212, 135, 14, 0.12);
    --charcoal: #1A1A1A;
    --warm-gray: #3D3935;
    --cream: #FAF7F2;
    --cream-dark: #F0EBE3;
    --iron: #5C5856;
    --text-secondary: #6B6560;
    --white: #FFFFFF;
    --green: #22C55E;
    --green-bg: #F0FDF4;
    --red: #EF4444;
    --red-bg: #FEF2F2;
    --blue: #3B82F6;
    --blue-bg: #EFF6FF;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--charcoal);
    background: var(--cream);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 1.25rem;
    background: rgba(250, 247, 242, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    color: var(--charcoal);
}

.logo span { color: var(--amber); }

/* ===== MAIN APP ===== */
#app {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

/* ===== STEPS ===== */
.step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-content {
    padding-top: 2rem;
}

.step-content.center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 60vh;
    min-height: 60dvh;
    justify-content: center;
}

/* ===== STEP ICONS ===== */
.step-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--amber-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--amber);
}

.step-icon.warning {
    background: var(--red-bg);
    color: var(--red);
}

.step-icon.escalation {
    background: var(--blue-bg);
    color: var(--blue);
}

/* ===== TYPOGRAPHY ===== */
h1, h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

h1 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.step-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed rgba(0,0,0,0.12);
    border-radius: var(--radius-lg);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--white);
    margin-bottom: 1rem;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--amber);
    background: var(--amber-glow);
}

.upload-zone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--iron);
}

.upload-text-main {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--charcoal);
}

.upload-text-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===== PHOTO PREVIEWS ===== */
.photo-previews {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.photo-preview {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== BUTTONS ===== */
.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--amber);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    background: var(--amber-light);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-secondary {
    width: 100%;
    padding: 0.85rem;
    background: var(--cream-dark);
    color: var(--charcoal);
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.btn-secondary:hover {
    background: var(--charcoal);
    color: var(--white);
}

.btn-secondary-outline {
    padding: 0.85rem 2rem;
    background: transparent;
    color: var(--amber);
    border: 2px solid var(--amber);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: 1.5rem;
}

.btn-secondary-outline:hover {
    background: var(--amber);
    color: var(--white);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    padding: 0.75rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    display: block;
    margin: 0.5rem auto 0;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--amber);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small:hover { background: var(--amber-light); }

.btn-small-outline {
    padding: 0.5rem 1rem;
    background: transparent;
    color: var(--charcoal);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-small-outline:hover {
    border-color: var(--charcoal);
}

/* ===== LOADER ===== */
.loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--cream-dark);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--amber);
}

/* ===== RESULT BADGE ===== */
.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--green-bg);
    color: var(--green);
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.result-badge-icon {
    font-size: 1.1rem;
}

.result-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: var(--white);
    border-radius: var(--radius);
    border-left: 3px solid var(--amber);
}

/* ===== FORM ===== */
.questions-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--charcoal);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--charcoal);
    background: var(--white);
    transition: border-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.form-input::placeholder {
    color: #B5B0AA;
}

.form-select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--charcoal);
    background: var(--white);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C5856' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-select:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ===== CARDS ===== */
.warning-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--red-bg);
    border-radius: var(--radius);
    color: var(--red);
    margin-bottom: 1rem;
    align-items: flex-start;
}

.warning-card svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-card p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--charcoal);
}

.info-card {
    padding: 1rem;
    background: var(--blue-bg);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.info-card p {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--charcoal);
    margin-bottom: 0.75rem;
}

.info-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===== LEAD FORM (contact step) ===== */
.lead-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid rgba(0,0,0,0.1);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    color: var(--charcoal);
    background: var(--white);
    resize: vertical;
    min-height: 80px;
    transition: border-color var(--transition);
    -webkit-appearance: none;
    appearance: none;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px var(--amber-glow);
}

.form-textarea::placeholder {
    color: #B5B0AA;
}

.field-required {
    color: var(--amber);
    font-size: 0.8rem;
}

.field-optional {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 400;
}

/* ===== CONTACT FORM ===== */
.contact-form {
    width: 100%;
    max-width: 360px;
    margin-top: 2rem;
}

.contact-form-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: left;
}

.contact-form .form-group {
    margin-bottom: 0.75rem;
}

/* ===== SUCCESS ===== */
.success-check {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--green-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green);
    margin-bottom: 1.5rem;
}

/* ===== UTILITY ===== */
.hidden {
    display: none !important;
}

/* ===== ERROR TOAST ===== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.85rem 1.5rem;
    background: var(--charcoal);
    color: white;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3s forwards;
    max-width: 90vw;
    text-align: center;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
    #app {
        padding: 0 2rem 4rem;
    }

    .step-content {
        padding-top: 3rem;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.6rem; }

    .upload-zone {
        padding: 3rem 2rem;
    }
}

@media (max-width: 380px) {
    .photo-preview {
        width: 64px;
        height: 64px;
    }
}
