/* ==========================================
   LOGIN PAGE - Split Screen Layout
   ========================================== */

/* Override layout for login - no sidebar, no nav */
.login-page {
    display: flex;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

/* Hide nav and main-content offset for login */
.login-page ~ .sidebar-nav,
body:has(.login-page) .sidebar-nav,
body:has(.login-page) .mobile-hamburger {
    display: none !important;
}

body:has(.login-page) .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
}

/* ==========================================
   LEFT PANEL - BRANDING
   ========================================== */
.login-brand-panel {
    flex: 0 0 480px;
    background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 50px;
    position: relative;
    overflow: hidden;
}

/* Subtle pattern overlay */
.login-brand-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(208, 167, 100, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(208, 167, 100, 0.06) 0%, transparent 50%),
        linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 78%);
    mask-image: radial-gradient(ellipse at 50% 45%, #000 30%, transparent 78%);
    pointer-events: none;
    z-index: 1;
}

/* Slow-drifting gold light behind the branding. Purely ambient: it sits under the
   content layer and is removed entirely under prefers-reduced-motion. */
.brand-aurora {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora-orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(64px);
    will-change: transform;
}

.aurora-orb-1 {
    width: 360px;
    height: 360px;
    top: -110px;
    left: -120px;
    background: radial-gradient(circle, rgba(208, 167, 100, 0.42) 0%, transparent 68%);
    animation: auroraDriftA 22s ease-in-out infinite;
}

.aurora-orb-2 {
    width: 300px;
    height: 300px;
    bottom: 6%;
    right: -110px;
    background: radial-gradient(circle, rgba(96, 143, 214, 0.34) 0%, transparent 68%);
    animation: auroraDriftB 28s ease-in-out infinite;
}

.aurora-orb-3 {
    width: 260px;
    height: 260px;
    top: 42%;
    left: 34%;
    background: radial-gradient(circle, rgba(208, 167, 100, 0.2) 0%, transparent 70%);
    animation: auroraDriftC 34s ease-in-out infinite;
}

@keyframes auroraDriftA {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(60px, 70px, 0) scale(1.14); }
}

@keyframes auroraDriftB {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1.06); }
    50% { transform: translate3d(-70px, -60px, 0) scale(0.92); }
}

@keyframes auroraDriftC {
    0%, 100% { transform: translate3d(0, 0, 0) scale(0.95); }
    50% { transform: translate3d(-40px, 50px, 0) scale(1.18); }
}

/* Decorative geometric accents */
.login-brand-panel::after {
    content: '';
    position: absolute;
    top: -120px;
    right: -120px;
    width: 300px;
    height: 300px;
    border: 1px solid rgba(208, 167, 100, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.brand-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 28px;
    background: linear-gradient(135deg, #d0a764 0%, #c49a58 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(208, 167, 100, 0.3);
}

/* Org-uploaded logo inside the gold brand tile (white-label auth pages). */
.brand-icon-img {
    max-height: 72px;
    width: auto;
}

/* Platform (Sahab Key) hero logo on the dark brand panel. Light variant,
   sized by height so the wordmark scales cleanly and never stretches. */
.brand-logo-hero {
    display: block;
    height: 40px;
    width: auto;
    max-width: 100%;
    margin: 0 auto 8px;
}

.login-brand-panel h1 {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.brand-tagline {
    color: rgba(255, 255, 255, 0.5);
    font-size: 15px;
    font-weight: 400;
    margin-bottom: 48px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 18px;
    text-align: left;
    max-width: 280px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 10px 6px 6px;
    margin: -6px -10px -6px -6px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    transition: color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.feature-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.feature-item .icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(208, 167, 100, 0.12);
    border: 1px solid rgba(208, 167, 100, 0.2);
    border-radius: 10px;
    color: #d0a764;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.feature-item:hover .icon {
    background: rgba(208, 167, 100, 0.22);
    border-color: rgba(208, 167, 100, 0.45);
    box-shadow: 0 6px 18px rgba(208, 167, 100, 0.25);
    transform: scale(1.06);
}

.brand-assurance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 280px;
    margin: 34px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.45);
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}

.brand-assurance .icon {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: rgba(208, 167, 100, 0.85);
}

.brand-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    padding-top: 40px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

.brand-footer strong {
    color: rgba(255, 255, 255, 0.5);
}

.brand-footer a {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.brand-footer a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* ==========================================
   RIGHT PANEL - LOGIN FORM
   ========================================== */
.login-form-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    /* A form taller than this panel scrolls inside it. Plain centering splits the
       overflow above and below, and the part above sits at a negative scroll offset
       that can never be reached; `safe` falls back to start in exactly that case. */
    align-items: safe center;
    padding: 48px 40px;
    background: #fff;
    overflow-y: auto;
    scroll-padding: 24px;
}

.login-form-wrap {
    width: 100%;
    max-width: 420px;
}

/* Mobile brand (hidden on desktop) */
.mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}

.brand-icon-sm {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #d0a764 0%, #c49a58 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

/* Org-uploaded logo inside the small gold tile (mobile brand row). */
.brand-icon-sm-img {
    max-height: 28px;
    width: auto;
}

/* Platform (Sahab Key) logo in the mobile brand row, on the white form panel.
   Espresso (dark-text) variant for the light background. */
.mobile-brand-logo {
    height: 30px;
    width: auto;
    max-width: 100%;
}

.mobile-brand span {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Header */
.login-header {
    margin-bottom: 36px;
}

.login-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.login-header p {
    color: #6b7280;
    font-size: 15px;
}

/* Form */
.login-form-wrap .form-group {
    margin-bottom: 18px;
}

.login-form-wrap label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

/* One field shape across the whole panel. Without this, plain fields fall back to
   the app-wide input rule in common.css and end up a different height, radius, and
   border weight than the icon fields beside them. */
.login-form-wrap .form-group > input,
.login-form-wrap .input-icon-wrap input,
.login-form-wrap .slug-input-row {
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

.login-form-wrap .form-group > input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-dark);
    transition: all 0.2s;
}

.login-form-wrap .form-group > input::placeholder,
.slug-input-row input::placeholder {
    color: #6b7280;
}

.login-form-wrap .form-group > input:focus {
    outline: none;
    border-color: #d0a764;
    box-shadow: 0 0 0 3px rgba(208, 167, 100, 0.1);
}

.login-form-wrap input[aria-invalid='true'],
.login-form-wrap .slug-input-row:has(input[aria-invalid='true']) {
    border-color: #dc2626;
    background: #fffafa;
}

.login-form-wrap .hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: #6b7280;
}

/* Sections. The form asks for two different things, who you are and what your
   company is, so it is split where that changes rather than run as one column. */
.form-section + .form-section {
    margin-top: 28px;
    padding-top: 26px;
    border-top: 1px solid #eef0f3;
}

.form-section-title {
    margin: 0 0 16px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #6b7280;
}

.req {
    color: #dc2626;
    font-weight: 600;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.label-row label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 13px;
    color: #8a6726;
    font-weight: 500;
    text-decoration: none;
}

.forgot-link:hover {
    color: #6f521e;
    text-decoration: underline;
}

/* Input with icon */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap > .icon:first-child {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s, transform 0.2s;
}

.input-icon-wrap input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-dark);
    background: #fff;
    transition: all 0.2s;
    outline: none;
}

.input-icon-wrap input::placeholder {
    color: #6b7280;
}

.input-icon-wrap input:focus {
    border-color: #d0a764;
    box-shadow:
        0 0 0 3px rgba(208, 167, 100, 0.12),
        0 6px 18px rgba(208, 167, 100, 0.14);
}

.input-icon-wrap:has(input:focus) > .icon:first-child {
    transform: translateY(-50%) scale(1.08);
}

.input-icon-wrap:has(input:focus) > .icon:first-child {
    color: #d0a764;
}

/* Password toggle */
.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    transition: color 0.15s;
}

.password-toggle-btn:hover {
    color: #d0a764;
}

.password-toggle-btn:focus {
    outline: none;
}

/* Keyboard focus stays visible; pointer focus does not show an outline. */
.password-toggle-btn:focus-visible {
    outline: 2px solid #d0a764;
    outline-offset: 2px;
    border-radius: 6px;
    color: #d0a764;
}

/* The 44px touch target (public/css/common.css) is wider than the input's own
   right padding, so keep a revealed password clear of it. */
@media (pointer: coarse) {
    .input-icon-wrap:has(.password-toggle-btn) input {
        padding-right: 58px;
    }
}

/* Workspace URL prefix + slug input (signup: new workspace; signup-verify: workspace-URL
   recovery when a slug is taken). The fixed host prefix reads as part of the same control
   as the editable slug, not a separate field beside it. Border, radius, and focus ring live
   on the row; the input drops its own so the two segments share one outline. The slug
   input itself is a plain .form-group field (no icon wrap), so height, border, radius, and
   colors here match that rule in public/css/common.css, not .input-icon-wrap above. */
.slug-input-row {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
    transition: all 0.2s;
}

.slug-input-row:has(input:focus) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(208, 167, 100, 0.1);
}

.slug-prefix {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    padding: 12px 12px 12px 14px;
    font-size: 14px;
    color: #6b7280;
    background: #f9fafb;
    border-right: 1.5px solid #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* flex-basis: 0 on the input (vs. auto on the prefix) means any shrink at a narrow
   viewport comes out of the prefix first, via its own ellipsis, instead of overflowing
   the row. */
.slug-input-row input {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 14px;
    border: none;
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    outline: none;
}

.slug-input-row input:focus {
    box-shadow: none;
}

/* Same 44px coarse-pointer minimum as the password toggle above; common.css's
   touch-target block does not cover plain .form-group inputs, only button-like
   controls, so it is set here. align-items: stretch carries the height to the prefix. */
@media (pointer: coarse) {
    .slug-input-row input {
        min-height: 44px;
    }
}

/* Yes/No choice (signup: investor payouts question) */
.signup-choice-group {
    margin: 0 0 20px;
    padding: 0;
    border: none;
    min-width: 0;
}

.signup-choice-group legend {
    display: block;
    padding: 0;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
}

.signup-choice {
    display: flex;
    gap: 10px;
}

.signup-choice .choice-option {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
    padding: 12px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.signup-choice .choice-option:hover {
    border-color: #d0a764;
}

.signup-choice .choice-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #d0a764;
    cursor: pointer;
}

.signup-choice .choice-option:has(input:checked) {
    border-color: #d0a764;
    background: rgba(208, 167, 100, 0.08);
    box-shadow: 0 0 0 3px rgba(208, 167, 100, 0.1);
}

.signup-choice .choice-option:has(input:focus-visible) {
    outline: 2px solid #d0a764;
    outline-offset: 2px;
}

/* Login button */
.btn-login {
    width: 100%;
    height: 48px;
    margin-top: 8px;
    background: linear-gradient(135deg, #d0a764 0%, #c49a58 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

/* Light sweeps across the button on hover. Decorative only, and it never covers the
   label: the sweep sits behind the text via z-index on .btn-text. */
.btn-login::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
    transform: skewX(-18deg);
    opacity: 0;
    pointer-events: none;
}

.btn-login:hover::after {
    opacity: 1;
    animation: btnSheen 0.75s ease-out;
}

.btn-login .btn-text,
.btn-login .btn-loading {
    position: relative;
    z-index: 1;
}

@keyframes btnSheen {
    from { left: -60%; }
    to { left: 115%; }
}

/* Anchor rendered as the primary button (signup verification result pages: the
   "Go to sign in" / "Start signup" calls to action have no form to submit). */
.btn-login-link {
    text-decoration: none;
}

.btn-login.is-loading .btn-text {
    visibility: hidden;
}

.btn-login.is-loading .btn-loading {
    display: inline-flex !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.btn-login:hover {
    background: linear-gradient(135deg, #c49a58 0%, #b8903a 100%);
    box-shadow: 0 4px 16px rgba(208, 167, 100, 0.35);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(208, 167, 100, 0.25);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Sign in <-> create workspace switch */
.login-switch {
    margin-top: 26px;
}

.login-switch-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    font-size: 12.5px;
    color: #6b7280;
}

.login-switch-divider::before,
.login-switch-divider::after {
    content: '';
    flex: 1 1 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e8eaee, transparent);
}

.btn-login-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: 1.5px solid #e3d9c6;
    border-radius: 10px;
    background: #fff;
    color: #8a6726;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.btn-login-secondary .icon {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.btn-login-secondary:hover {
    border-color: #d0a764;
    background: rgba(208, 167, 100, 0.08);
    color: #6f521e;
    box-shadow: 0 4px 14px rgba(208, 167, 100, 0.18);
    transform: translateY(-1px);
}

.btn-login-secondary:hover .icon {
    transform: translateX(3px);
}

.btn-login-secondary:active {
    transform: translateY(0);
}

.btn-login-secondary:focus-visible {
    outline: 2px solid #d0a764;
    outline-offset: 2px;
}

/* Alerts */
.login-form-wrap .alert {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Submit-time summary, above the form so it is never below the fold of a long one. */
.login-form-wrap .alert-top {
    margin: 0 0 20px;
}

.login-form-wrap .alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.login-form-wrap .alert-success {
    background: #f0fdf4;
    color: #047857;
    border: 1px solid #bbf7d0;
}

/* Resend verification (shown after a signup posts "check your email") */
.resend-panel {
    margin-top: 16px;
    text-align: center;
}

.resend-panel .resend-prompt {
    margin: 0 0 10px;
    font-size: 13px;
    color: #6b7280;
}

.resend-panel .hint {
    display: block;
    margin-top: 8px;
}

.hint.success {
    color: #047857;
}

.hint.error {
    color: #dc2626;
}

/* Password requirements (signup). Each line turns green once it is satisfied and red
   once it is not, but only after typing starts, so an untouched field reads as a
   neutral list of rules rather than five failures. */
.pw-reqs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 8px 0 0;
    padding: 0;
    font-size: 11.5px;
    color: #6b7280;
}

.pw-reqs li {
    padding: 3px 9px;
    border: 1px solid #eceef1;
    border-radius: 999px;
    background: #f8f9fa;
}

.pw-reqs li.met {
    color: #047857;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.pw-reqs li.unmet {
    color: #dc2626;
    border-color: #fecaca;
    background: #fef2f2;
}

/* Help section */
.login-help {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
    text-align: center;
}

.login-help > p {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.help-contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.help-contacts a {
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s;
}

.help-contacts a:hover {
    color: #d0a764;
}

.help-contacts a .icon {
    color: #d0a764;
    font-size: 12px;
    width: 14px;
}

/* Back to login link */
.back-to-login {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.back-to-login:hover {
    color: #d0a764;
}

.back-to-login .icon {
    font-size: 12px;
}

/* Readonly input */
.input-readonly {
    background: #f9fafb !important;
    color: #6b7280 !important;
    cursor: not-allowed;
}

/* Form hint text */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

/* Legal links */
.login-legal {
    margin-top: 20px;
    text-align: center;
    font-size: 12px;
    color: #6b7280;
}

.login-legal a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.login-legal a:hover {
    color: #8a6726;
}

.legal-consent {
    margin-bottom: 18px;
}

.legal-consent label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.55;
    color: #4b5563;
}

.legal-consent input[type='checkbox'] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: #d0a764;
    cursor: pointer;
}

.legal-consent a {
    color: #8a6726;
    text-decoration: none;
}

.legal-consent a:hover {
    color: #6f521e;
    text-decoration: underline;
}

.signup-addons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.addon-option {
    align-items: flex-start;
    gap: 10px;
    text-align: left;
}

.addon-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.addon-copy small {
    font-size: 12px;
    color: #6f6753;
    line-height: 1.45;
}

.signup-quote {
    margin: 8px 0 4px;
    padding: 14px 16px;
    border: 1px solid #ece7dd;
    border-radius: 10px;
    background: #fbf9f4;
}

.signup-quote .quote-table {
    width: 100%;
    border-collapse: collapse;
}

.signup-quote .quote-table td {
    padding: 9px 0;
    border-bottom: 1px solid #ece7dd;
    vertical-align: top;
}

.signup-quote .quote-table tfoot td {
    border-bottom: none;
    border-top: 2px solid #ddceaa;
    padding-top: 11px;
    font-weight: 700;
    color: #3f3a2f;
}

.signup-quote .quote-line-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #3f3a2f;
}

.signup-quote .quote-line-detail {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: #6f6753;
}

.signup-quote .quote-line-amount {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: #3f3a2f;
}

/* Price, billing interval, and automatic renewal, stated in full above the
   consent checkbox. Always visible: never a tooltip, an accordion, or a link. */
.renewal-terms {
    margin: 4px 0 16px;
    padding: 14px 16px;
    border: 1px solid #ece7dd;
    border-left: 3px solid #8a6726;
    border-radius: 10px;
    background: #fbf9f4;
}

.renewal-terms p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #4b4636;
}

.renewal-terms .renewal-terms-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #3f3a2f;
}

.login-legal span {
    margin: 0 8px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s;
}

/* Entrance animation */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(-14px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.login-form-wrap {
    animation: fadeIn 0.4s ease-out both;
}

.brand-content {
    animation: fadeSlideUp 0.6s ease-out 0.1s both;
}

/* The panel arrives as a sequence rather than a single block: header, then each
   field, then the calls to action. */
.login-form-wrap > .login-header,
.login-form-wrap > form > .form-group,
.login-form-wrap > form > .btn-login,
.login-form-wrap > .login-switch,
.login-form-wrap > .login-help,
.login-form-wrap > .login-legal {
    animation: fadeSlideUp 0.5s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.login-form-wrap > .login-header { animation-delay: 0.06s; }
.login-form-wrap > form > .form-group:nth-of-type(1) { animation-delay: 0.13s; }
.login-form-wrap > form > .form-group:nth-of-type(2) { animation-delay: 0.19s; }
.login-form-wrap > form > .form-group:nth-of-type(n + 3) { animation-delay: 0.24s; }
.login-form-wrap > form > .btn-login { animation-delay: 0.28s; }
.login-form-wrap > .login-switch { animation-delay: 0.34s; }
.login-form-wrap > .login-help { animation-delay: 0.4s; }
.login-form-wrap > .login-legal { animation-delay: 0.44s; }

.brand-features .feature-item {
    animation: fadeSlideIn 0.55s cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

.brand-features .feature-item:nth-child(1) { animation-delay: 0.3s; }
.brand-features .feature-item:nth-child(2) { animation-delay: 0.42s; }
.brand-features .feature-item:nth-child(3) { animation-delay: 0.54s; }
.brand-features .feature-item:nth-child(n + 4) { animation-delay: 0.66s; }

.brand-assurance {
    animation: fadeIn 0.6s ease-out 0.8s both;
}

/* Motion here is decoration, never information: with it suppressed the page still
   reads and behaves identically, ambient light included. */
@media (prefers-reduced-motion: reduce) {
    .login-page *,
    .login-page *::before,
    .login-page *::after {
        animation-duration: 0.001s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001s !important;
    }

    .brand-aurora {
        display: none;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .login-brand-panel {
        flex: 0 0 380px;
        padding: 40px 36px;
    }
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }

    .login-brand-panel {
        display: none;
    }

    .mobile-brand {
        display: flex;
    }

    .login-form-panel {
        padding: 24px;
    }

    .login-header h2 {
        font-size: 22px;
    }
}

.login-form-wrap .form-group > input[type='checkbox'],
.login-form-wrap .form-group > input[type='radio'] {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--primary-color);
}
