/* ===================================================================
   RED — MASTERBOOST.NET
   Pagini de autentificare (login, 2FA, resetare parolă)
   =================================================================== */

:root {
    --bg-void: #08090b;
    --bg-deep: #0b0c0e;
    --bg-card: rgba(20, 22, 26, 0.88);
    --bg-inset: rgba(9, 10, 12, 0.72);

    --gold: #de9b35;
    --gold-bright: #f0be62;
    --gold-dim: rgba(222, 155, 53, 0.16);

    --blue: #2f9de4;
    --blue-bright: #6ec8ff;

    --text: #e9e7e2;
    --text-muted: #9aa0aa;
    --text-faint: #666c76;

    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --danger: #d6473f;
    --success: #45ab6c;

    --font-display: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
    --font-body: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'DejaVu Sans Mono', monospace;

    --radius: 3px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

.auth-body {
    margin: 0;
    min-height: 100%;
    min-height: 100dvh;
    background: var(--bg-void);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Straturi de fundal ------------------------------------------ */

.auth-bg,
.auth-scan,
.auth-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.auth-bg {
    background-image: url('img/bg.jpg');
    background-size: cover;
    background-position: center 38%;
    z-index: 0;
}

.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 45%, rgba(8, 9, 11, 0.35) 0%, rgba(8, 9, 11, 0.92) 78%),
        linear-gradient(180deg, rgba(8, 9, 11, 0.9) 0%, rgba(8, 9, 11, 0.55) 45%, rgba(8, 9, 11, 0.95) 100%);
}

/* Linii orizontale foarte fine — textură de „monitor tactic” */
.auth-scan {
    z-index: 1;
    background-image: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.018) 0px,
        rgba(255, 255, 255, 0.018) 1px,
        transparent 1px,
        transparent 3px
    );
    opacity: 0.6;
}

.auth-glow {
    z-index: 1;
    filter: blur(90px);
    opacity: 0.42;
}

.auth-glow-gold {
    background: radial-gradient(circle 380px at 22% 26%, rgba(222, 155, 53, 0.5), transparent 70%);
}

.auth-glow-blue {
    background: radial-gradient(circle 420px at 80% 76%, rgba(47, 157, 228, 0.42), transparent 70%);
}

/* --- Cardul ------------------------------------------------------ */

.auth-shell {
    position: relative;
    z-index: 2;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px calc(32px + env(safe-area-inset-bottom));
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    padding: 34px 32px 24px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: card-in 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

/* Linia aurie de sus, tăiată în trepte — semnătura vizuală a panelului */
.auth-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold-bright) 50%, var(--blue) 88%, transparent);
    box-shadow: 0 0 18px rgba(222, 155, 53, 0.55);
}

.auth-card {
    position: relative;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Antet / logo ------------------------------------------------ */

.auth-head {
    text-align: center;
    margin-bottom: 22px;
}

.auth-logo {
    width: 280px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 14px;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.6));
}

.auth-wordmark {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-wordmark-red {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 3px;
    color: var(--gold);
    text-shadow: 0 0 22px rgba(222, 155, 53, 0.45);
}

.auth-wordmark-bar {
    width: 1px;
    height: 18px;
    background: var(--border-strong);
}

.auth-wordmark-tag {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 2.2px;
    color: var(--text-faint);
    text-transform: uppercase;
}

/* --- Blocul de detecție ------------------------------------------ */

.detect {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.detect-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.028);
    border-bottom: 1px solid var(--border);
}

.detect-title {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--text-faint);
}

.detect-badge {
    font-family: var(--font-mono);
    font-size: 8.5px;
    letter-spacing: 1.2px;
    color: var(--success);
    border: 1px solid rgba(69, 171, 108, 0.4);
    background: rgba(69, 171, 108, 0.1);
    border-radius: 2px;
    padding: 2px 7px;
    white-space: nowrap;
}

.detect-rows {
    padding: 4px 12px 8px;
}

.detect-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 6px 0;
    min-width: 0;
}

.detect-row + .detect-row {
    border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.detect-flag {
    width: 22px;
    height: 16px;
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.detect-flag-blank,
.detect-os-blank {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: 2px;
}

.detect-os {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    object-fit: contain;
}

.detect-os-blank {
    width: 18px;
    height: 18px;
}

.detect-label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detect-value {
    flex: 0 0 auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* --- Mesaje ------------------------------------------------------ */

.auth-intro {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--text-muted);
}

.auth-intro strong {
    color: var(--text);
    font-weight: 700;
}

.auth-error,
.auth-notice {
    font-size: 13.5px;
    line-height: 1.5;
    padding: 11px 13px;
    border-radius: var(--radius);
    margin-bottom: 18px;
    border-left: 3px solid;
}

.auth-error {
    background: rgba(214, 71, 63, 0.11);
    border-color: var(--danger);
    color: #f0a5a0;
}

.auth-notice {
    background: rgba(47, 157, 228, 0.1);
    border-color: var(--blue);
    color: #a5d4f2;
}

/* --- Formulare --------------------------------------------------- */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.field {
    display: block;
}

.field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 6px;
}

.auth-body input[type='text'],
.auth-body input[type='email'],
.auth-body input[type='password'] {
    width: 100%;
    background: var(--bg-inset);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 12px 13px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.auth-body input::placeholder {
    color: var(--text-faint);
    font-weight: 500;
}

.auth-body input:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(9, 10, 12, 0.9);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

/* Autofill-ul Chrome pune fundal alb peste tema dark */
.auth-body input:-webkit-autofill,
.auth-body input:-webkit-autofill:hover,
.auth-body input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 1000px #101216 inset;
    caret-color: var(--text);
}

.field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-faint);
}

.field-password {
    position: relative;
}

.field-password input {
    padding-right: 46px;
}

.reveal {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.reveal::before {
    content: '';
    position: absolute;
    inset: 8px;
    background: currentColor;
    color: var(--text-faint);
    -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    transition: color 0.16s;
}

.reveal:hover::before {
    color: var(--text-muted);
}

.reveal.is-on::before {
    color: var(--gold);
}

/* --- Câmpul de cod ----------------------------------------------- */

.code-input {
    font-family: var(--font-mono) !important;
    font-size: 30px !important;
    font-weight: 700 !important;
    text-align: center;
    letter-spacing: 14px !important;
    text-indent: 14px; /* compensează letter-spacing-ul de după ultima cifră */
    padding: 15px 10px !important;
    color: var(--gold) !important;
}

.code-input:focus {
    box-shadow: 0 0 0 3px var(--gold-dim), 0 0 30px rgba(222, 155, 53, 0.18) !important;
}

/* --- Checkbox ---------------------------------------------------- */

.check {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-muted);
    user-select: none;
}

.check input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 0;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    background: var(--bg-inset);
    cursor: pointer;
    position: relative;
    transition: border-color 0.16s, background 0.16s;
}

.check input:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.check input:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid #0b0c0e;
    border-width: 0 2px 2px 0;
    transform: rotate(42deg);
}

.check:hover input {
    border-color: var(--gold);
}

/* --- Butoane ----------------------------------------------------- */

.btn-auth {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 13px 20px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--gold) 0%, #c8862a 100%);
    color: #0b0c0e;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.12s, box-shadow 0.16s, filter 0.16s;
    box-shadow: 0 6px 20px rgba(222, 155, 53, 0.24);
}

.btn-auth::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transition: left 0.5s ease;
}

.btn-auth:hover {
    filter: brightness(1.07);
    box-shadow: 0 8px 28px rgba(222, 155, 53, 0.36);
}

.btn-auth:hover::after {
    left: 130%;
}

.btn-auth:active {
    transform: translateY(1px);
}

.btn-auth-link {
    display: block;
}

/* --- Linkuri ----------------------------------------------------- */

.auth-links {
    margin-top: 18px;
    text-align: center;
}

.auth-links-split {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}

.inline-form {
    margin: 0;
    display: inline;
}

.link-btn {
    background: none;
    border: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px dashed rgba(47, 157, 228, 0.45);
    cursor: pointer;
    transition: color 0.16s, border-color 0.16s;
}

.link-btn:hover {
    color: var(--blue-bright);
    border-bottom-color: var(--blue-bright);
}

.link-btn-muted {
    color: var(--text-faint);
    border-bottom-color: rgba(255, 255, 255, 0.16);
}

.link-btn-muted:hover {
    color: var(--text-muted);
    border-bottom-color: var(--border-strong);
}

/* --- Stări blocate / finalizate ---------------------------------- */

.auth-blocked,
.auth-done {
    text-align: center;
    padding: 8px 0 4px;
}

.auth-blocked h2,
.auth-done h2 {
    margin: 14px 0 10px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1.2px;
    color: var(--text);
}

.auth-blocked p,
.auth-done p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.auth-blocked strong,
.auth-done strong {
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
}

.auth-blocked-hint {
    font-size: 12.5px !important;
    color: var(--text-faint) !important;
    line-height: 1.65 !important;
}

.auth-blocked-hint code,
.auth-done code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--gold);
    background: var(--bg-inset);
    padding: 1px 5px;
    border-radius: 2px;
}

.auth-blocked-icon,
.auth-done-icon {
    display: inline-block;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid;
}

.auth-blocked-icon {
    border-color: rgba(214, 71, 63, 0.5);
    background:
        no-repeat center / 22px 22px
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d6473f' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"),
        rgba(214, 71, 63, 0.08);
}

.auth-done-icon {
    border-color: rgba(69, 171, 108, 0.5);
    background:
        no-repeat center / 22px 22px
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2345ab6c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5.5 5.5L20 7'/%3E%3C/svg%3E"),
        rgba(69, 171, 108, 0.08);
}

/* --- Subsol ------------------------------------------------------ */

.auth-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--text-faint);
}

.auth-foot-sep {
    opacity: 0.4;
}

/* --- Responsive --------------------------------------------------- */

@media (max-width: 480px) {
    .auth-bg {
        background-image: url('img/bg-mobile.jpg');
        background-position: center 42%;
    }

    .auth-shell {
        padding: 20px 14px calc(20px + env(safe-area-inset-bottom));
        align-items: flex-start;
    }

    .auth-card {
        padding: 26px 20px 20px;
        border-radius: 5px;
    }

    .auth-card::before {
        left: 14px;
        right: 14px;
    }

    .auth-logo {
        width: 220px;
    }

    .auth-wordmark-red {
        font-size: 19px;
    }

    .detect-value {
        font-size: 10px;
    }

    .code-input {
        font-size: 25px !important;
        letter-spacing: 9px !important;
        text-indent: 9px;
    }

    .auth-glow {
        opacity: 0.3;
    }
}

/* Ecrane foarte înguste (iPhone SE) */
@media (max-width: 360px) {
    .detect-label {
        font-size: 12.5px;
    }

    .detect-value {
        font-size: 9.5px;
    }

    .code-input {
        font-size: 21px !important;
        letter-spacing: 6px !important;
        text-indent: 6px;
    }
}

/* Telefon în landscape — cardul nu trebuie să fie centrat vertical */
@media (max-height: 620px) and (orientation: landscape) {
    .auth-shell {
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

@media (min-width: 1400px) {
    .auth-card {
        max-width: 440px;
    }
}

/* Preferință de sistem: fără animații */
@media (prefers-reduced-motion: reduce) {
    .auth-card {
        animation: none;
    }

    .btn-auth::after {
        display: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}

/* Fundal de rezervă dacă imaginea nu se încarcă */
@media (prefers-contrast: more) {
    .auth-card {
        background: #14161a;
        backdrop-filter: none;
    }
}
