/* auth.css - Shared styles for Checkora Authentication Pages */
.header,
.auth-card {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    background-color: #0f0f1a;
    color: #d0d0d0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;

    min-height: 100vh;

    display: flex;
    justify-content: centre;
    gap: 10px;
    align-items: center;

    flex-direction: column;

    padding: 24px 20px;

    overflow-x: hidden;
}

/* .header { margin-bottom: 30px; text-align: center; } */
/* ============================================================
   Header
   ============================================================ */

   .header { 
    padding: 10px 0 6px; 
    display: flex;
    flex-direction: column; /* Stack logo container and subtitle <p> */

    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 580px;
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Logo image - FIXED: Single rule with animation */
.logo-icon-img {
    height: 40px;
    animation: logoGlow 2.5s ease-in-out infinite alternate;
}

/* Logo glow animation - FIXED: Single keyframes definition */
@keyframes logoGlow {
    0% {
        filter: brightness(1.6) contrast(1.3)
                drop-shadow(0 0 4px rgba(0, 200, 255, 0.3));
    }
    100% {
        filter: brightness(1.6) contrast(1.3)
                drop-shadow(0 0 12px rgba(0, 200, 255, 0.8));
    }
}

/* Logo text */ 
.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #f0c040;
    text-transform: uppercase;
}

/* Responsive logo sizes */
@media (max-width: 768px) {
    .logo-icon-img {
        height: 26px;
    }
    .logo-text {
        font-size: 20px;
    }
}


.auth-card {
    background: #16162a;
    border: 1px solid #252545;
    border-radius: 12px;

    width: min(90vw, 520px);

    padding: 18px 24px;

    margin: 0px auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: auto;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    max-height: 90vh;
    overflow-y: auto;
}

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 1rem;
    color: #8a8aaa;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}
.form-group input {
    width: 100%;
    padding: 16px 18px;
    background: #0f0f1a;
    border: 1px solid #333;
    border-radius: 6px;
    color: #fff;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}
.form-group input:focus {
    outline: none;
    border-color: #f0c040;
    box-shadow: 0 0 0 2px rgba(240, 192, 64, 0.2);
}

.helptext {
    font-size: 0.82rem;
    color: #9a9abb;
    margin-top: 6px;
    display: block;
    line-height: 1.5;
}

.helptext ul {
    padding-left: 16px;
    margin-top: 6px;
}

.helptext li {
    font-size: 0.82rem;
    color: #9a9abb;
    line-height: 1.8;
}
.errorlist {
    list-style: none;
    color: #ff6b6b;
    font-size: 0.8rem;
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
    border-radius: 4px;
}
.message-list {
    margin-bottom: 18px;
}
.message {
    color: #ffb4b4;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 10px 12px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 3px solid #ff6b6b;
    border-radius: 4px;
}
.message + .message {
    margin-top: 8px;
}
.message-success {
    color: #b5f5c8;
    background: rgba(76, 175, 80, 0.12);
    border-left-color: #4caf50;
}

.btn {
    width: 100%;
    padding: 14px 0;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    margin-top: 10px;
}
.btn-gold {
    background: linear-gradient(135deg, #f0c040, #d4a020);
    color: #1a1a2e;
}
.btn-gold:hover {
    background: linear-gradient(135deg, #f5cc55, #e0b030);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(240, 192, 64, 0.25);
}

/* ── Loading spinner state ── */
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}
.btn.is-loading {
    pointer-events: none;
    opacity: 0.75;
    position: relative;
    color: transparent !important;
    cursor: not-allowed;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(26, 26, 46, 0.3);
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

.auth-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 0.95rem;
    color: #8a8aaa;
}
.auth-footer a {
    color: #f0c040;
    text-decoration: none;
    font-weight: 600;
}
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    body {
        padding: 20px;
    }

    .auth-card {
        padding: 24px 20px;
        max-width: 100%;
    }

    .header h1 {
        font-size: 1.8rem;
    }
}
.back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    color: #f0c040;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
}
.back-home:hover {
    color: #fff;
}

/* ── Password visibility toggle ── */
.pw-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.pw-input-wrapper input {
    padding-right: 2.5rem;
}
.pw-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    color: #8a8aaa;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s ease;
    z-index: 2;
}
.pw-toggle:hover {
    color: #f0c040;
}
.pw-toggle:focus-visible {
    outline: 2px solid #f0c040;
    outline-offset: 2px;
    border-radius: 4px;
}
.pw-toggle svg {
    display: block;
    pointer-events: none;
}

body.login-page .helptext {
    display: none;
}

/* ── Password validation checklist ── */
.password-checklist {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    font-size: 0.8rem;
    color: #6a6a8a;
    opacity: 1;
    max-height: 120px;
    overflow: hidden;
    transition: opacity 0.4s ease, max-height 0.4s ease, margin 0.4s ease;
}
.password-checklist li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
    transition: color 0.25s ease, opacity 0.4s ease;
}
.password-checklist .check-icon {
    width: 14px;
    height: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #444;
    border-radius: 50%;
    transition: all 0.25s ease;
    flex-shrink: 0;
}
.password-checklist li.met .check-icon {
    border-color: #4caf50;
    background: #4caf50;
}
.password-checklist li.met .check-icon::after {
    content: '✓';
    color: #fff;
    font-size: 10px;
    line-height: 1;
}
.password-checklist li.met {
    color: #4caf50;
}
.password-checklist.all-met {
    opacity: 0;
    max-height: 0;
    margin: 0;
    pointer-events: none;
}

.paste-block-msg {
    font-size: 0.75rem;
    color: #ffb4b4;
    padding: 6px 8px;
    margin-top: 4px;
    background: rgba(255, 107, 107, 0.1);
    border-left: 2px solid #ff6b6b;
    border-radius: 4px;
    animation: fade-out 0.3s ease 2.7s forwards;
}

@keyframes fade-out {
    to { opacity: 0; height: 0; padding: 0; margin: 0; }
}

/* ── Toast Notifications ── */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: #16162a;
    color: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #f0c040;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    font-size: 0.95rem;
    animation: toast-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex;
    align-items: center;
    max-width: calc(100vw - 40px);
}
.toast-success { border-left-color: #4caf50; }
.toast-error { border-left-color: #ff6b6b; }
.toast-warning { border-left-color: #f0c040; }

@keyframes toast-enter {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.toast-exit {
    animation: toast-exit-anim 0.4s ease forwards !important;
}
@keyframes toast-exit-anim {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 600px) {
    .auth-card {
        padding: 30px 20px;
    }
}
/* Responsive Fixes */

@media (max-width: 768px) {
    body {
        padding: 20px 16px;
    }

    .auth-card {
        width: 100%;
        padding: 24px 18px;
    }

    .header {
        width: 100%;
        max-width: 100%;
    }
}

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