﻿/* ===============================
   SpeakOut Staff MVC — Auth Styles
   Final modern auth UI
================================= */

/* ==========================================================
   1) Theme Tokens
========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
    --c-cyan: #34d399;
    --c-teal: #14b8a6;
    --c-blue: #3b82f6;
    --c-indigo: #6366f1;
    --c-navy: #0f172a;
    --c-danger: #ef4444;
    --c-success: #22c55e;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-700: #334155;
    --slate-900: #0f172a;
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 15px;
    --radius-sm: 11px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, .08);
    --shadow-md: 0 20px 50px rgba(15, 23, 42, .12);
    --shadow-glow: 0 18px 40px rgba(20, 184, 166, .18);
    --ring-blue: 0 0 0 4px rgba(59, 130, 246, .16);
    --ring-brand: 0 0 0 4px rgba(20, 184, 166, .16);
    --grad-brand: linear-gradient(135deg, #34d399 0%, #14b8a6 55%, #0ea5e9 100%);
    --grad-soft: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.82));
    --grad-text: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", "Noto Sans", sans-serif;
}

/* ==========================================================
   2) Base Reset
========================================================== */
* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    font-size: 15px;
}

body {
    margin: 0;
    font-family: var(--bs-font-sans-serif);
    color: var(--slate-900);
    background: radial-gradient(circle at top left, rgba(52, 211, 153, .08), transparent 30%), radial-gradient(circle at top right, rgba(59, 130, 246, .08), transparent 30%), linear-gradient(180deg, #f8fbff 0%, #f4f8fc 40%, #f8fafc 100%);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    opacity: 1;
    transition: opacity 180ms ease, background-color .18s ease, color .18s ease;
    line-height: 1.5;
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

a {
    text-decoration: none;
    color: inherit;
}

::selection {
    background: rgba(20, 184, 166, .18);
    color: var(--slate-900);
}

:focus-visible {
    outline: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    box-shadow: var(--ring-brand);
}

/* ==========================================================
   3) Helpers
========================================================== */
.text-danger {
    color: #b91c1c;
    font-size: 12px;
    margin-top: 6px;
    display: inline-block;
    font-weight: 600;
}

.center {
    text-align: center;
}

.footer-note {
    text-align: center;
    color: var(--slate-400);
    font-size: 11px;
    margin-top: 16px;
    font-weight: 500;
}

/* ==========================================================
   4) Layout
========================================================== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 14px;
    position: relative;
    overflow: hidden;
}

    .auth-wrap::before,
    .auth-wrap::after {
        content: "";
        position: absolute;
        border-radius: 999px;
        filter: blur(60px);
        pointer-events: none;
        z-index: 0;
    }

    .auth-wrap::before {
        width: 240px;
        height: 240px;
        left: -60px;
        top: -40px;
        background: rgba(52, 211, 153, .14);
    }

    .auth-wrap::after {
        width: 280px;
        height: 280px;
        right: -80px;
        bottom: -80px;
        background: rgba(59, 130, 246, .12);
    }

.auth-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 14px;
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

    .auth-logo img {
        height: 100px;
        width: auto;
        filter: drop-shadow(0 12px 24px rgba(15, 23, 42, .08));
    }

.auth-title {
    margin: 8px 0 6px;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-subtitle {
    margin: 0 0 8px;
    color: var(--slate-500);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.55;
}

/* ==========================================================
   5) Card
========================================================== */
.card {
    position: relative;
    background: var(--grad-soft);
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

    .card::before {
        content: "";
        position: absolute;
        inset: 0 auto auto 0;
        width: 100%;
        height: 4px;
        background: var(--grad-brand);
        opacity: .95;
    }

    .card > * {
        position: relative;
        z-index: 1;
    }

/* ==========================================================
   6) Form
========================================================== */
.form-group {
    margin-bottom: 13px;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-700);
    margin-bottom: 6px;
    letter-spacing: -.01em;
}

.input {
    width: 100%;
    height: 42px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, .95);
    background: rgba(248, 250, 252, .84);
    padding: 0 13px;
    outline: none;
    color: var(--slate-900);
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
    box-shadow: var(--shadow-xs);
    font-size: 13px;
}

    .input::placeholder {
        color: var(--slate-400);
    }

    .input:hover {
        border-color: var(--slate-300);
        background: rgba(255,255,255,.92);
    }

    .input:focus {
        border-color: rgba(59, 130, 246, .40);
        background: #fff;
        box-shadow: var(--ring-blue);
    }

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-500);
    font-size: 12px;
    font-weight: 500;
}

    .remember input[type="checkbox"] {
        width: 15px;
        height: 15px;
        accent-color: #14b8a6;
        cursor: pointer;
    }

/* ==========================================================
   7) Links + Buttons
========================================================== */
.link {
    color: #0f766e;
    font-weight: 700;
    text-decoration: none;
    font-size: 12px;
    transition: opacity .16s ease, color .16s ease;
}

    .link:hover {
        opacity: .9;
        color: #0d9488;
    }

.btn-primary {
    width: 100%;
    height: 42px;
    border: 0;
    border-radius: var(--radius-md);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: -.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--grad-brand);
    transition: transform .14s ease, opacity .14s ease, box-shadow .18s ease;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(20, 184, 166, .18);
}

    .btn-primary:hover {
        opacity: .98;
        transform: translateY(-1px);
        box-shadow: var(--shadow-glow);
    }

    .btn-primary:disabled {
        opacity: .7;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .btn-primary:visited {
        color: #fff;
    }

/* ==========================================================
   8) Errors
========================================================== */
.error {
    background: linear-gradient(180deg, #fff5f5, #fef2f2);
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: var(--radius-md);
    padding: 10px 11px;
    font-size: 12px;
    margin: 11px 0;
    box-shadow: 0 1px 2px rgba(239, 68, 68, .05);
}

/* ==========================================================
   9) Password Toggle
========================================================== */
.pw-wrap {
    position: relative;
}

    .pw-wrap .input {
        padding-right: 40px;
    }

.pw-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--slate-400);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .16s ease, color .16s ease;
}

    .pw-toggle:hover {
        color: var(--slate-700);
        background: rgba(15, 23, 42, .05);
    }

    .pw-toggle i {
        font-size: 16px;
    }

/* ==========================================================
   10) OTP Boxes
========================================================== */
.otp-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.otp {
    width: 44px;
    height: 48px;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    border-radius: 13px;
    border: 2px solid var(--slate-200);
    background: rgba(248, 250, 252, .9);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
}

    .otp:hover {
        border-color: var(--slate-300);
        background: #fff;
    }

    .otp:focus {
        border-color: rgba(59, 130, 246, .45);
        background: #fff;
        box-shadow: var(--ring-blue);
        transform: translateY(-1px);
    }

.success-icon {
    font-size: 44px;
    color: #16a34a;
    filter: drop-shadow(0 8px 18px rgba(22, 163, 74, .18));
}

/* ==========================================================
   11) Live UX Add-ons
========================================================== */
html.is-loading body {
    opacity: 0;
}

body {
    opacity: 1;
    transition: opacity 180ms ease;
}

.top-loader {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    z-index: 9999;
    background: linear-gradient(90deg, #3b82f6, #14b8a6, #22c55e);
    opacity: 0;
    transform: translateZ(0);
}

    .top-loader.active {
        opacity: 1;
        transition: width 180ms ease, opacity 180ms ease;
    }

    .top-loader.done {
        opacity: 0;
        transition: opacity 220ms ease;
    }

.btn-primary.is-busy {
    opacity: 0.85;
    pointer-events: none;
}

.btn-primary .btn-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    margin-right: 8px;
    vertical-align: -2px;
    animation: btnspin 0.8s linear infinite;
}

.btn-primary.is-busy .btn-spinner {
    display: inline-block;
}

@keyframes btnspin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================
   12) Responsive
========================================================== */
@media (max-width: 520px) {
    .auth-wrap {
        padding: 16px 12px;
    }

    .auth-container {
        max-width: 100%;
    }

    .auth-logo img {
        height: 82px;
    }

    .auth-title {
        font-size: 26px;
    }

    .auth-subtitle {
        font-size: 13px;
    }

    .card {
        padding: 16px;
        border-radius: 18px;
    }

    .input,
    .btn-primary {
        height: 40px;
    }

    .otp-row {
        gap: 7px;
    }

    .otp {
        width: 38px;
        height: 42px;
        font-size: 15px;
    }

    .row-between {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================
   13) Reduced Motion
========================================================== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    body {
        transition: none;
    }
}

/* ==========================================================
   14) Gentle compact mode for higher effective scale
========================================================== */
html.ui-compact {
    font-size: 14px;
}

    html.ui-compact .auth-container {
        max-width: 388px;
    }

    html.ui-compact .auth-wrap {
        padding: 16px 12px;
    }

        html.ui-compact .auth-wrap::before {
            width: 210px;
            height: 210px;
        }

        html.ui-compact .auth-wrap::after {
            width: 240px;
            height: 240px;
        }

    html.ui-compact .auth-header {
        margin-bottom: 12px;
    }

    html.ui-compact .auth-logo img {
        height: 84px;
    }

    html.ui-compact .auth-title {
        font-size: 25px;
        margin: 6px 0 4px;
    }

    html.ui-compact .auth-subtitle {
        font-size: 13px;
        line-height: 1.45;
    }

    html.ui-compact .card {
        padding: 18px;
        border-radius: 18px;
    }

    html.ui-compact .form-group {
        margin-bottom: 11px;
    }

    html.ui-compact label {
        font-size: 11px;
        margin-bottom: 5px;
    }

    html.ui-compact .input {
        height: 38px;
        padding: 0 11px;
        font-size: 12px;
        border-radius: 13px;
    }

    html.ui-compact .pw-wrap .input {
        padding-right: 36px;
    }

    html.ui-compact .pw-toggle {
        width: 28px;
        height: 28px;
        right: 8px;
    }

        html.ui-compact .pw-toggle i {
            font-size: 15px;
        }

    html.ui-compact .remember {
        font-size: 11px;
    }

        html.ui-compact .remember input[type="checkbox"] {
            width: 14px;
            height: 14px;
        }

    html.ui-compact .link {
        font-size: 11px;
    }

    html.ui-compact .btn-primary {
        height: 38px;
        font-size: 12px;
        border-radius: 13px;
    }

    html.ui-compact .error {
        padding: 9px 10px;
        font-size: 11px;
        margin: 10px 0;
    }

    html.ui-compact .text-danger {
        font-size: 11px;
        margin-top: 5px;
    }

    html.ui-compact .footer-note {
        font-size: 10px;
        margin-top: 14px;
    }

    html.ui-compact .otp-row {
        gap: 8px;
    }

    html.ui-compact .otp {
        width: 38px;
        height: 42px;
        font-size: 14px;
        border-radius: 12px;
    }

    html.ui-compact .success-icon {
        font-size: 38px;
    }

@media (max-width: 520px) {
    html.ui-compact .auth-container {
        max-width: 100%;
    }

    html.ui-compact .auth-logo img {
        height: 72px;
    }

    html.ui-compact .auth-title {
        font-size: 23px;
    }

    html.ui-compact .card {
        padding: 14px;
    }

    html.ui-compact .input,
    html.ui-compact .btn-primary {
        height: 38px;
    }

    html.ui-compact .otp {
        width: 34px;
        height: 38px;
        font-size: 13px;
    }
}
