/* ---------- Design tokens ---------- */
:root {
    --navy-900: #0D1E36;
    --navy-800: #10233F;
    --navy-700: #1B3358;
    --navy-600: #2B4A7A;
    --gold-500: #E3A23C;
    --gold-600: #C9832090;
    --teal-600: #1E7D6B;
    --paper: #F4F5F3;
    --card: #FFFFFF;
    --ink: #10233F;
    --ink-muted: #5B6B82;
    --line: rgba(16, 35, 63, 0.12);
    --line-strong: rgba(16, 35, 63, 0.22);
    --danger: #C0392B;
    --danger-bg: #FBEAE8;
    --success: #1E7D6B;
    --success-bg: #E7F3F0;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --shadow-card: 0 24px 48px -24px rgba(13, 30, 54, 0.28);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
}

body {
    display: flex;
}

.page {
    display: grid;
    grid-template-columns: minmax(320px, 40%) 1fr;
    min-height: 100vh;
    width: 100%;
}

/* ---------- Brand panel ---------- */
.brand-panel {
    background: linear-gradient(165deg, var(--navy-900) 0%, var(--navy-700) 100%);
    color: #EDEFF3;
    padding: 3rem 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.02em;
}

.brand-copy h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(28px, 3.4vw, 42px);
    line-height: 1.15;
    margin: 0 0 1rem;
}

.brand-copy p {
    font-size: 15px;
    line-height: 1.6;
    color: #C3CBDA;
    max-width: 34ch;
    margin: 0;
}

/* Signature element: the orientation path */
.path {
    list-style: none;
    margin: 2.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.path-step {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    position: relative;
}

.path-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 30px;
    width: 1px;
    height: 24px;
    background: rgba(237, 239, 243, 0.22);
}

.path-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid rgba(237, 239, 243, 0.4);
    flex-shrink: 0;
}

.path-step.is-active .path-dot {
    background: var(--gold-500);
    border-color: var(--gold-500);
    box-shadow: 0 0 0 4px rgba(227, 162, 60, 0.22);
}

.path-label {
    font-size: 14px;
    color: rgba(237, 239, 243, 0.62);
}

.path-step.is-active .path-label {
    color: #EDEFF3;
    font-weight: 500;
}

.brand-foot {
    font-size: 12.5px;
    color: rgba(237, 239, 243, 0.5);
    margin: 2.5rem 0 0;
}

/* ---------- Form panel ---------- */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.form-card {
    width: 100%;
    max-width: 460px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 2.25rem 2.25rem 2rem;
}

.tabs {
    display: flex;
    background: var(--paper);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 1.75rem;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-muted);
    border-radius: calc(var(--radius-sm) - 2px);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tab-btn.active {
    background: var(--card);
    color: var(--navy-800);
    box-shadow: 0 1px 2px rgba(13, 30, 54, 0.08);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 24px;
    margin: 0 0 4px;
    color: var(--navy-900);
}

.subtitle {
    font-size: 14px;
    color: var(--ink-muted);
    margin: 0 0 1.5rem;
}

/* ---------- Form elements ---------- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.form-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.9rem 0.9rem 0.2rem;
    margin: 0 0 1.1rem;
}

.form-fieldset legend {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-muted);
    padding: 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--navy-800);
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    font-family: var(--font-body);
    font-size: 14.5px;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder {
    color: #9AA6B8;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(43, 74, 122, 0.15);
}

input.error,
select.error {
    border-color: var(--danger);
}

input.error:focus {
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.input-with-action {
    position: relative;
}

.input-with-action input {
    padding-right: 78px;
}

.toggle-visibility {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--navy-600);
    cursor: pointer;
    padding: 6px 8px;
}

.error {
    display: none;
    font-size: 12.5px;
    color: var(--danger);
    margin-top: 5px;
}

.error.show {
    display: block;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.25rem 0 1.5rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 400;
    color: var(--ink-muted);
    cursor: pointer;
}

.checkbox input {
    width: 16px;
    height: 16px;
    accent-color: var(--navy-700);
    margin: 0;
}

.checkbox-terms {
    margin: 0.6rem 0 0.25rem;
}

.link-muted {
    font-size: 13px;
    color: var(--navy-600);
    text-decoration: none;
    font-weight: 600;
}

.link-muted:hover {
    text-decoration: underline;
}

/* Password strength */
.password-strength {
    height: 4px;
    background: var(--line);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.strength-meter {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.2s ease, background 0.2s ease;
}

.strength-meter.weak { width: 33%; background: var(--danger); }
.strength-meter.fair { width: 66%; background: var(--gold-500); }
.strength-meter.strong { width: 100%; background: var(--teal-600); }

.strength-text {
    display: block;
    font-size: 12px;
    color: var(--ink-muted);
    margin-top: 4px;
}

/* ---------- Buttons ---------- */
.btn {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14.5px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-block {
    width: 100%;
    padding: 13px 0;
    margin-top: 0.4rem;
}

.btn-primary {
    background: var(--navy-800);
    color: #FFFFFF;
}

.btn-primary:hover {
    background: var(--navy-700);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FFFFFF;
    border-radius: 50%;
}

.btn.is-loading .btn-spinner {
    display: inline-block;
    animation: spin 0.7s linear infinite;
}

.btn.is-loading .btn-label {
    opacity: 0.85;
}

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

/* ---------- Messages ---------- */
.message {
    display: none;
    margin-top: 1rem;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.5;
}

.message.show {
    display: block;
}

.message.success {
    background: var(--success-bg);
    color: var(--success);
}

.message.error {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        padding: 2.25rem 1.75rem;
    }

    .path {
        margin-top: 1.75rem;
    }

    .brand-foot {
        display: none;
    }

    .form-panel {
        padding: 2rem 1.25rem 3rem;
    }
}

@media (max-width: 520px) {
    .form-card {
        padding: 1.75rem 1.25rem 1.5rem;
        border-radius: var(--radius-md);
        box-shadow: none;
        border: 1px solid var(--line);
    }

    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .brand-copy h1 {
        font-size: 26px;
    }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

:focus-visible {
    outline: 2px solid var(--navy-600);
    outline-offset: 2px;
}
