/* Auth Modal & Components - Metallic Theme */

/* -- Modal -- */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #333;
    border-top: 1px solid #444;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.auth-modal-overlay.open .auth-modal {
    transform: scale(1);
}

.auth-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f20d0d, #800000);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #666;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: white;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #999;
    font-size: 0.875rem;
}

/* -- Forms -- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.form-label {
    color: #ccc;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: #fff;
    font-family: 'Noto Sans', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    /* Ensure full width */
}

/* Fix for Chrome/Edge Autofill turning background white */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #0a0a0a inset !important;
    -webkit-text-fill-color: white !important;
    caret-color: white;
}

.form-input:focus {
    outline: none;
    border-color: #f20d0d;
    box-shadow: 0 0 0 3px rgba(242, 13, 13, 0.15);
}

.validation-msg {
    font-size: 0.75rem;
    height: 1.2em;
    opacity: 0;
    transition: opacity 0.2s;
}

.validation-msg.visible {
    opacity: 1;
}

.validation-msg.success {
    color: #00a152;
}

.validation-msg.error {
    color: #f20d0d;
}

/* -- Buttons -- */
.btn-auth {
    width: 100%;
    padding: 0.875rem;
    border: none;
    border-radius: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #f20d0d;
    color: white;
    box-shadow: 0 4px 15px rgba(242, 13, 13, 0.3);
}

.btn-primary:hover {
    background: #d60b0b;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(242, 13, 13, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-google {
    background: white;
    color: #333;
    margin-bottom: 1.5rem;
}

.btn-google:hover {
    background: #f0f0f0;
}

.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #555;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #333;
}

.divider span {
    padding: 0 1rem;
}

.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #888;
}

.auth-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    margin-left: 0.25rem;
    cursor: pointer;
}

.auth-link:hover {
    text-decoration: underline;
    color: #f20d0d;
}

/* -- Toast -- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: #1a1a1a;
    border-left: 4px solid #f20d0d;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    top: -20px;
    opacity: 0;
    animation: slideInToast 0.3s forwards;
    min-width: 300px;
}

.toast.success {
    border-left-color: #00a152;
}

.toast.error {
    border-left-color: #f20d0d;
}

@keyframes slideInToast {
    to {
        top: 0;
        opacity: 1;
    }
}

/* -- Score Banner -- */
/* -- Result Card -- */
.result-card-overlay {
    position: fixed;
    inset: 0;
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    /* Mobile dynamic viewport fix */
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.result-card-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.result-card {
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 1px solid #333;
    border-top: 2px solid #f20d0d;
    border-radius: 16px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-card-overlay.open .result-card {
    transform: translateY(0) scale(1);
}

/* Typography override for big numbers */
#result-time {
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 30px rgba(242, 13, 13, 0.2);
}