/* static/css/user/login_register.css */

/* ================================
    CONTAINER
================================ */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    /* 100vh - navbar (80px) - footer (auto) - padding (4rem) */
    min-height: calc(100vh - 80px - 80px); 
    padding: 2rem 1rem;
}

/* ================================
    AUTH CARD
================================ */

.auth-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* For animations */
}

/* ================================
    TAB SWITCHER
================================ */

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    background: var(--bg-glass-light);
    border-radius: var(--border-radius-md);
    padding: 0.25rem;
}

.auth-tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 0.375rem; /* --border-radius-md */
    transition: all 0.3s ease;
    cursor: pointer;
}

.auth-tab-btn:hover:not(.active):not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.auth-tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.2);
}

.auth-tab-btn:disabled {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

/* ================================
    FORM STYLES
================================ */

.auth-form {
    /* Animation for switching */
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form.hidden {
    display: none;
}

.auth-title {
    text-align: center;
    font-weight: 700;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ================================
    FORM ELEMENTS (INPUTS)
================================ */

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1rem; /* RTL */
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

/* Universal class for Django widgets and custom inputs */
.form-control-glass,
input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    height: 50px;
    background: var(--bg-glass-light);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 0.5rem 1rem 0.5rem 1rem; /* RTL */
    padding-right: 2.75rem !important; /* Space for icon */
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    /* -webkit-appearance: none; Fix for iOS */
}

/* Style Django's default widget classes */
.form-control-glass,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-glass);
    box-shadow: 0 0 10px rgba(74, 144, 226, 0.2);
    color: #fff;
}

/* Highlight icon on focus */
.form-control-glass:focus + i,
input[type="text"]:focus ~ i,
input[type="email"]:focus ~ i,
input[type="password"]:focus ~ i {
    color: var(--primary-color);
}

/* ================================
    HELPERS & ERRORS
================================ */

.form-text-helper {
    text-align: left; /* RTL */
    margin-top: -0.75rem;
    margin-bottom: 1.25rem;
}

.form-text-helper a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}
.form-text-helper a:hover {
    color: var(--text-light);
}

/* Field-specific errors */
.form-error {
    color: #f87171; /* Light red from base.css */
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.35rem;
    padding-right: 0.25rem;
}

/* Non-field errors (from Django) or AJAX messages */
.auth-alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius-md);
    border: 1px solid;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}
.auth-alert i {
    margin-left: 0.5rem;
}

.auth-alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.4);
    color: #f87171;
}

.auth-alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.auth-alert-warning {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

/* ================================
    SUBMIT BUTTON
================================ */

.btn-submit-auth {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.05rem;
    font-weight: 600;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-submit-auth:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 20px rgba(74, 144, 226, 0.3);
    transform: translateY(-2px);
}

.btn-submit-auth:disabled {
    background: #334155; /* Muted bg */
    color: #94a3b8; /* Muted text */
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================
    RESPONSIVE
================================ */

@media (max-width: 500px) {
    .auth-card {
        padding: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
    }

    /* .auth-tabs {
        /* You could stack them if you want */
        /* flex-direction: column; */
    /* } */ */

    .auth-tab-btn {
        font-size: 0.95rem;
    }
}