/*
 * GANITSUTRAM
 * A Living Knowledge Ecosystem for Mathematical Discovery
 *
 * "यथा शिखा मयूराणां नागानां मणयो यथा
 *  तद्वद् वेदाङ्गशास्त्राणां गणितं मूर्ध्नि वर्तते"
 *
 * As the crest of a peacock, as the gem on the hood
 * of a cobra — so stands mathematics at the crown
 * of all knowledge.
 *                                       — Brahmagupta
 *                                         628 CE · Brahmasphutasiddhanta
 *
 * Creator:   Jawahar R. Mallah
 * Email:     jawahar@aitdl.com
 * GitHub:    https://github.com/jawahar-mallah
 * Websites:  https://ganitsutram.com
 *            https://aitdl.com
 *
 * Then:  628 CE · Brahmasphutasiddhanta
 * Now:   8 March MMXXVI · Vikram Samvat 2082
 *
 * Copyright © 2026 Jawahar R. Mallah · AITDL | GANITSUTRAM
 *
 * Developer Note:
 * If you intend to reuse this code, please respect
 * the creator and the work behind it.
 */
/**
 * Project: GanitSūtram
 * Author: Jawahar R Mallah
 * Company: AITDL | aitdl.com
 * 
 * Date:
 * Vikram Samvat: VS 2082
 * Gregorian: 2026-03-07
 * 
 * Purpose: Authentication UI System Styles.
 *          Implements modal, forms, and toast notifications.
 */

/* --- AUTH MODAL --- */
.gs-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 14, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gs-auth-overlay.active {
    opacity: 1;
    visibility: visible;
}

.gs-auth-modal {
    background: var(--bg-card);
    width: 90%;
    max-width: 440px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}

.gs-auth-overlay.active .gs-auth-modal {
    transform: translateY(0);
}

.gs-auth-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.gs-auth-close:hover {
    color: var(--text-primary);
}

/* --- MODAL CONTENT --- */
.gs-auth-header {
    padding: 40px 30px 20px;
    text-align: center;
}

.gs-auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.gs-auth-logo .sanskrit {
    color: var(--accent-primary);
}

.gs-auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.gs-auth-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.gs-auth-tab.active {
    color: var(--accent-primary);
}

.gs-auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
}

.gs-auth-body {
    padding: 30px;
}

.gs-auth-panel {
    display: none;
}

.gs-auth-panel.active {
    display: block;
    animation: authFadeIn 0.3s ease;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- FORMS --- */
.gs-auth-group {
    margin-bottom: 20px;
}

.gs-auth-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.gs-auth-input-wrap {
    position: relative;
}

.gs-auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    padding-right: 45px;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    transition: border-color 0.2s;
}

.gs-auth-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.gs-auth-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
}

.gs-auth-error {
    color: #ff4d4d;
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
}

/* --- STRENGTH INDICATOR --- */
.gs-auth-strength {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
    display: none;
}

.gs-auth-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
}

.gs-auth-strength-text {
    font-size: 0.75rem;
    margin-top: 5px;
    color: var(--text-dim);
}

/* --- ROLE SELECTOR --- */
.gs-auth-roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.gs-auth-role {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.gs-auth-role:hover {
    background: rgba(255, 255, 255, 0.05);
}

.gs-auth-role.active {
    border-color: var(--accent-primary);
    background: rgba(0, 163, 255, 0.1);
    color: var(--accent-primary);
}

/* --- BUTTONS --- */
.gs-auth-submit {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: var(--btn-primary-bg);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s, background 0.2s;
}

.gs-auth-submit:hover {
    background: var(--btn-primary-hover);
    transform: scale(1.02);
}

.gs-auth-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.gs-auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
    display: none;
}

@keyframes authSpin {
    to {
        transform: rotate(360deg);
    }
}

.gs-auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.gs-auth-switch-link {
    color: var(--accent-primary);
    cursor: pointer;
    font-weight: 600;
}

.gs-auth-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.2);
}

/* --- TOAST SYSTEM --- */
.gs-toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gs-toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 12px;
    min-width: 280px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    animation: toastIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes toastIn {
    to {
        transform: translateX(0);
    }
}

.gs-toast.fade-out {
    animation: toastOut 0.4s forwards;
}

@keyframes toastOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.gs-toast-success {
    border-left: 4px solid #4caf50;
}

.gs-toast-error {
    border-left: 4px solid #ff4d4d;
}

.gs-toast-info {
    border-left: 4px solid var(--accent-primary);
}

.gs-toast-icon {
    font-size: 1.2rem;
}

.gs-toast-message {
    font-size: 0.9rem;
    font-weight: 500;
}