/* register.css — Apple-design registration page
   Principles applied: materials & depth, typography (tracking/leading),
   response (instant press feedback), spatial consistency, reduced motion. */

/* Language visibility */
.lang-en {
    display: none;
}

.lang-he {
    display: inline;
}

html[lang="en"] .lang-en {
    display: inline;
}

html[lang="en"] .lang-he {
    display: none;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font: 100%/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
    min-height: 100vh;
    color: #1a1a2e;
    direction: rtl;
    /* Override styles.css flex constraint */
    display: block;
    align-items: unset;
    max-width: none;
    width: 100%;
    padding: 0;
    background: #0a0a14;
}

/* === LAYOUT: full-bleed split === */
.register-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* === HERO: full atmospheric image === */
.register-hero {
    position: relative;
    background: url('/images/ODB-Private-Agents.jpg') center/cover no-repeat;
    min-height: 100vh;
}

/* Top gradient for logo contrast */
.register-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.hero-logo {
    position: relative;
    z-index: 1;
    display: block;
    padding: 36px 40px;
}

.hero-logo img {
    height: 34px;
}

/* LTR adjustments */
html[lang="en"] .register-form-panel {
    direction: ltr;
}

html[lang="en"] .consent-row {
    direction: ltr;
}

html[lang="en"] input[type="email"] {
    text-align: left;
}

/* === FORM PANEL: translucent material === */
.register-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    /* Frosted glass material — heavier weight for structural region */
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.form-container {
    width: 100%;
    max-width: 380px;
}

.mobile-logo {
    display: none;
}

/* === TYPOGRAPHY: Apple-style hierarchy === */
.form-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.15;
    letter-spacing: -0.02em;
    /* tighten large text */
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: #6b7280;
    letter-spacing: 0.005em;
    /* slightly open for small text */
    margin-bottom: 36px;
}

/* === STEPS === */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Step entrance — JS-driven spring replaces this for supported browsers */
.step.active {
    animation: stepIn 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.0);
}

@keyframes stepIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .step.active {
        animation: none;
    }
}

/* === GOOGLE BUTTON === */
.google-btn-container {
    display: flex;
    justify-content: center;
    margin-bottom: 4px;
}

/* === DIVIDER === */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: #9ca3af;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* === INPUTS === */
.input-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

input[type="tel"],
input[type="email"] {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    direction: ltr;
    text-align: center;
    letter-spacing: 0.3px;
    background: rgba(249, 250, 251, 0.8);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="tel"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fff;
}

input[type="email"] {
    text-align: right;
}

/* OTP: large monospace */
.otp-input {
    font-size: 1.5rem;
    letter-spacing: 5px;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    padding: 15px 16px;
}

/* === CONSENT === */
.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 10px 0;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.4;
    text-align: right;
    justify-content: flex-start;
}

.consent-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    accent-color: #3b82f6;
    flex-shrink: 0;
    border-radius: 4px;
}

.consent-row a {
    color: #3b82f6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* === BUTTONS — instant press feedback (Apple principle #1) === */
.btn-primary {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #1a1a2e;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: -0.005em;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    /* Respond on pointer-down — feedback is instant */
    transition: transform 100ms ease-out, opacity 100ms ease-out;
    will-change: transform;
}

.btn-primary:hover {
    opacity: 0.92;
}

/* Scale on press — pointer-down, not release */
.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    opacity: 1;
}

/* === MESSAGES === */
.form-message {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-align: center;
    background: #f9fafb;
    line-height: 1.5;
}

/* === STEP INFO === */
.step-info {
    font-size: 0.92rem;
    color: #4b5563;
    margin-bottom: 22px;
    text-align: center;
    line-height: 1.5;
}

/* === BACK LINK === */
.back-link {
    display: block;
    margin-top: 18px;
    text-align: center;
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: #4b5563;
}

/* === SUCCESS (step 4) === */
#step4 {
    text-align: center;
    padding: 48px 0;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 20px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1a1a2e;
    animation: dotPulse 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes dotPulse {

    0%,
    60%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .loading-dots span {
        animation: none;
        opacity: 0.6;
    }
}

/* === FORM FOOTER === */
.form-footer {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    font-size: 0.82rem;
    color: #9ca3af;
}

.form-footer a {
    color: #4b5563;
    font-weight: 500;
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* === SHAKE — consent validation feedback === */
.shake {
    animation: shakeAnim 0.35s ease;
}

@keyframes shakeAnim {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .register-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 280px 1fr;
    }

    .register-hero {
        min-height: unset;
    }

    .hero-logo {
        padding: 24px;
    }

    .register-form-panel {
        padding: 36px 24px 48px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
        /* Overlap the hero slightly for depth */
        margin-top: -24px;
        border-radius: 24px 24px 0 0;
    }

    .mobile-logo {
        display: block;
        margin-bottom: 24px;
    }

    .mobile-logo img {
        height: 28px;
    }

    .form-title {
        font-size: 1.5rem;
    }

    .form-subtitle {
        margin-bottom: 28px;
    }
}

@media (max-width: 420px) {
    .register-layout {
        grid-template-rows: 200px 1fr;
    }

    .register-form-panel {
        padding: 28px 18px 40px;
    }

    .form-container {
        max-width: 100%;
    }

    .otp-input {
        font-size: 1.3rem;
        letter-spacing: 4px;
    }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
    .btn-primary {
        transition: none;
    }

    .btn-primary:active {
        transform: none;
        opacity: 0.8;
    }

    .register-form-panel {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: #fff;
    }
}

/* === REDUCED TRANSPARENCY === */
@media (prefers-reduced-transparency: reduce) {
    .register-form-panel {
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}