/* ftf brand overlay for /log-in/ and /sign-up/.
   Loaded AFTER auth.css so it overrides palette + typography while leaving
   the structural class names (auth-shell / auth-card / auth-field / ...)
   identical. The shared JS in /auth/auth.js depends on those class hooks
   — they MUST stay. Style only. */

:root {
    --ftf-bg:        #FDF6F0;
    --ftf-bg-grad-a: #FFF8F2;
    --ftf-bg-grad-b: #FFEDE3;
    --ftf-bg-grad-c: #E6F4F1;
    --ftf-card:      #FFFFFF;
    --ftf-border:    #F0E4D9;
    --ftf-fg:        #2A1810;
    --ftf-fg-soft:   #4A382E;
    --ftf-muted:     #7A6F66;
    --ftf-accent:    #FF7A45;
    --ftf-accent-hi: #FF6B33;
    --ftf-accent-dim:#FFEDE3;
    --ftf-mint:      #B5EAEA;
    --ftf-radius-lg: 16px;
    --ftf-radius-md: 10px;
    --ftf-radius-sm: 8px;
}

html, body {
    background:
        radial-gradient(circle at top right, rgba(181,234,234,0.45) 0%, transparent 50%),
        linear-gradient(160deg, var(--ftf-bg) 0%, var(--ftf-bg-grad-a) 50%, var(--ftf-bg-grad-c) 100%);
    background-attachment: fixed;
    color: var(--ftf-fg);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    min-height: 100vh;
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    max-width: none;
    margin: 0;
}

.auth-header {
    padding: 24px 32px;
    background: transparent;
    border-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--ftf-fg);
    text-decoration: none;
}
.auth-header .logo img { display: none; }
.auth-header .logo::before {
    content: "🌉";
    font-size: 26px;
    line-height: 1;
}
.auth-header .logo::after {
    content: "FotifyPay";
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 16px 40px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: var(--ftf-card);
    border: 1px solid var(--ftf-border);
    border-radius: var(--ftf-radius-lg);
    padding: 36px 40px;
    box-shadow:
        0 4px 24px -8px rgba(42, 24, 16, 0.10),
        0 1px 2px rgba(42, 24, 16, 0.04);
}
.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--ftf-fg);
    margin: 0 0 8px;
}
.auth-card .auth-sub {
    color: var(--ftf-muted);
    font-size: 14.5px;
    margin: 0 0 24px;
}
.auth-card .auth-sub a {
    color: var(--ftf-accent);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px dashed var(--ftf-accent-dim);
}
.auth-card .auth-sub a:hover { border-bottom-style: solid; }

.auth-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: var(--ftf-radius-md);
    font-size: 13.5px;
    line-height: 1.5;
    display: none;
}
.auth-notice.is-visible { display: block; }
.auth-notice--error {
    background: #FFEBE4;
    border: 1px solid #FFC9B5;
    color: #8B2E12;
}
.auth-notice--success {
    background: #E0F2EC;
    border: 1px solid #A8D7C5;
    color: #1F5C44;
}

.auth-oauth { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: var(--ftf-card);
    border: 1px solid var(--ftf-border);
    border-radius: 999px;
    color: var(--ftf-fg);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.05s ease;
}
.btn-oauth:hover { border-color: var(--ftf-accent); background: var(--ftf-accent-dim); }
.btn-oauth:active { transform: translateY(1px); }
.btn-oauth svg { width: 18px; height: 18px; flex-shrink: 0; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 8px 0 20px;
    color: var(--ftf-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ftf-border);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ftf-fg-soft);
    letter-spacing: 0.01em;
}
.input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
}
.input-wrap input {
    width: 100%;
    padding: 12px 14px;
    background: #FCFAF7;
    border: 1px solid var(--ftf-border);
    border-radius: var(--ftf-radius-md);
    color: var(--ftf-fg);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.input-wrap input::placeholder { color: #B3A496; }
.input-wrap input:hover { border-color: #E0D2C3; }
.input-wrap input:focus {
    outline: none;
    border-color: var(--ftf-accent);
    background: var(--ftf-card);
    box-shadow: 0 0 0 3px rgba(255, 122, 69, 0.15);
}
.input-wrap input[aria-invalid="true"] {
    border-color: #E37356;
    background: #FFF6F2;
}
.toggle-visibility {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: 0;
    color: var(--ftf-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.toggle-visibility:hover { color: var(--ftf-fg); background: var(--ftf-accent-dim); }
.toggle-visibility svg { width: 18px; height: 18px; }

.field-error,
.field-hint {
    font-size: 12.5px;
    line-height: 1.45;
    min-height: 0;
}
.field-error { color: #B2401F; display: none; }
.field-error:not(:empty) { display: block; }
.field-hint { color: var(--ftf-muted); }

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    font-size: 13px;
    color: var(--ftf-muted);
}
.auth-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.auth-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ftf-accent); cursor: pointer; }
.auth-row a {
    color: var(--ftf-accent);
    font-weight: 700;
    text-decoration: none;
}
.auth-row a:hover { text-decoration: underline; }

.auth-submit {
    margin-top: 8px;
    width: 100%;
    padding: 14px 18px;
    background: var(--ftf-accent);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.005em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 2px 12px -3px rgba(255, 122, 69, 0.45);
    transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.18s ease;
}
.auth-submit:hover:not(:disabled) {
    background: var(--ftf-accent-hi);
    box-shadow: 0 4px 18px -3px rgba(255, 122, 69, 0.55);
}
.auth-submit:active:not(:disabled) { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.auth-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    display: none;
    animation: auth-spin 0.8s linear infinite;
}
.auth-submit.is-loading .auth-spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-fineprint {
    margin: 20px 0 0;
    text-align: center;
    color: var(--ftf-muted);
    font-size: 13px;
    line-height: 1.5;
}
.auth-fineprint a { color: var(--ftf-accent); font-weight: 600; text-decoration: none; }
.auth-fineprint a:hover { text-decoration: underline; }

.auth-footer {
    padding: 20px 16px 28px;
    text-align: center;
    color: var(--ftf-muted);
    font-size: 12px;
}

@media (max-width: 520px) {
    .auth-card { padding: 28px 22px; border-radius: var(--ftf-radius-md); }
    .auth-card h1 { font-size: 24px; }
}
