﻿/* ================================
   Authentication Shared Styles
   ================================ */

/* Main authentication wrapper - centers content vertically */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: transparent;
    overflow-x: hidden;
}

.auth-wrapper .container {
    width: 100%;
    max-width: 1200px;
}

/* Authentication card container - clean modern surface */
.auth-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    background: var(--bg-primary);
    width: 100%;
    margin: 0 auto;
}

.auth-card:not(.login-horizontal):not(.register-horizontal) {
    max-width: 720px;
}

/* Card body padding and background */
.auth-card .card-body {
    padding: 2.5rem;
    background-color: var(--bg-primary);
}

/* Authentication header with brand gradient background */
.auth-header {
    background: var(--brand-gradient);
    color: #ffffff;
    padding: 2.5rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.auth-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.9rem;
    letter-spacing: 0.03em;
}

.auth-logo {
    width: 100%;
    max-width: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2rem auto;
}

.auth-logo svg,
.auth-logo img {
    width: auto;
    height: auto;
    max-width: 100%;
    min-width: 0;
    display: block;
    object-fit: contain;
}

.auth-logo .auth-logo-svg-container {
    max-width: 100%;
    min-width: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    box-sizing: border-box;
}

.auth-logo .auth-logo-svg-container svg,
.auth-logo svg.auth-logo-svg {
    width: auto;
    max-width: 100%;
    min-width: 0;
    height: auto;
    max-height: 180px;
    display: block;
}

.auth-divider {
    position: relative;
    text-align: center;
    margin: 2rem 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: var(--border-color);
}

.auth-divider::before {
    left: 0;
}

.auth-divider::after {
    right: 0;
}

.auth-footer {
    color: var(--tt-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.auth-footer small {
    color: inherit;
}

@media (prefers-color-scheme: dark) {
    .auth-footer {
        color: rgba(226, 232, 240, 0.85);
    }
}

.auth-highlight {
    background-color: var(--accent-soft);
    border-left: 4px solid var(--accent);
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
}

.auth-badge {
    background: rgba(1, 43, 86, 0.85);
    color: #ffffff;
    padding: 0.2rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.auth-toggle {
    border-color: var(--accent-soft-border) !important;
    color: var(--accent) !important;
    background: var(--accent-soft) !important;
}

.auth-toggle:hover,
.auth-toggle:focus {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #ffffff !important;
    box-shadow: var(--shadow-sm);
}

/* ================================
   Password Strength Indicator
   ================================ */

/* Password strength bar container */
.password-strength {
    height: 5px;
    border-radius: 3px;
    transition: all 0.3s;
    margin-top: 5px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Weak password indicator - red, 33% width */
.password-weak {
    background: #dc3545;
    width: 33%;
}

/* Medium password indicator - yellow, 66% width */
.password-medium {
    background: #ffc107;
    width: 66%;
}

/* Strong password indicator - green, 100% width */
.password-strong {
    background: #28a745;
    width: 100%;
}

.username-field-container {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.username-field-container.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

@media (max-width: 576px) {
    .auth-card {
        border-radius: 1rem;
    }

    .auth-card .card-body {
        padding: 2rem 1.5rem;
    }

    .auth-header {
        padding: 2rem 1.5rem;
    }

    .auth-header h3 {
        font-size: 1.6rem;
    }

    .auth-logo {
        max-width: 100%;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ================================
   Dark Mode Overrides
   ================================ */
@media (prefers-color-scheme: dark) {
    body {
        background: var(--bg-secondary);
    }

    .auth-card {
        background: var(--bg-primary);
        border-color: var(--border-color);
        box-shadow: var(--shadow-lg);
    }

    .auth-card .card-body {
        background-color: transparent;
    }

    .auth-divider {
        color: rgba(255, 255, 255, 0.6);
    }

    .auth-divider::before,
    .auth-divider::after {
        background: rgba(255, 255, 255, 0.25);
    }

    .auth-highlight {
        background-color: rgba(0, 94, 184, 0.2);
        border-left-color: rgba(0, 94, 184, 0.55);
        color: #e9ecef;
    }

    .auth-badge {
        background: rgba(0, 94, 184, 0.75);
    }

    /* Form controls */
    .form-control {
        background-color: #2a2a2a;
        border-color: #444;
        color: #f1f1f1;
    }

        .form-control:focus {
            border-color: #66afe9;
            box-shadow: 0 0 0 0.2rem rgba(102,175,233,0.25);
            background-color: #2a2a2a;
            color: #fff;
        }

        .form-control.is-valid {
            border-color: #28a745;
            background-color: #1e2a21;
            color: #d4f8e8;
        }

            .form-control.is-valid:focus {
                border-color: #28a745;
                box-shadow: 0 0 0 0.2rem rgba(40,167,69,0.35);
            }

        .form-control.is-invalid {
            border-color: #dc3545;
            background-color: #2a1e1e;
            color: #f5c6cb;
        }

            .form-control.is-invalid:focus {
                border-color: #dc3545;
                box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.35);
            }

    /* Alerts */
    .alert {
        border: none;
        border-radius: 0.5rem;
    }

    .alert-danger {
        background-color: #4d2020;
        color: #f8a1a1;
    }

    .alert-success {
        background-color: #204d3b;
        color: #9fffc8;
    }

    /* Checkboxes / radios */
    .form-check-input {
        background-color: #2a2a2a;
        border-color: #555;
    }

        .form-check-input:focus {
            border-color: #66afe9;
            box-shadow: 0 0 0 0.2rem rgba(102,175,233,0.25);
        }

    /* Cards */
    .card {
        background-color: #1e1e1e;
        border: none;
        border-radius: 1rem;
    }

    .card-title {
        color: #e9ecef;
        font-weight: 600;
    }

    /* Buttons */
    .btn-success {
        background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
        color: #fff;
    }

        .btn-success:hover {
            background: linear-gradient(135deg, #218838 0%, #1fa384 100%);
            box-shadow: 0 4px 12px rgba(40,167,69,0.5);
        }

    .btn-outline-primary {
        color: #66b2ff;
        border-color: #66b2ff;
    }

        .btn-outline-primary:hover {
            background-color: #0d6efd;
            color: #fff;
        }

    /* Input group */
    .input-group-text {
        background-color: #2a2a2a;
        border-color: #444;
        color: #ddd;
    }

    /* Fix: Show/Hide Password Toggle Button */
    .auth-toggle {
        border-color: rgba(102, 175, 233, 0.6) !important;
        color: #66b2ff !important;
        background: rgba(102, 175, 233, 0.15) !important;
    }

    .auth-toggle:hover,
    .auth-toggle:focus {
        background: var(--brand-gradient) !important;
        border-color: #66b2ff !important;
        color: #ffffff !important;
        box-shadow: 0 0.65rem 1.35rem rgba(102, 175, 233, 0.3);
    }

    .auth-toggle i {
        color: inherit !important;
    }

    .input-group .toggle-password {
        color: #ccc;
        background-color: #2a2a2a;
        border-color: #444;
        cursor: pointer;
    }

        .input-group .toggle-password:hover {
            color: #fff;
        }

        .input-group .toggle-password i {
            pointer-events: none; /* ensure clicks hit the button */
        }

    /* If using absolute-positioned icon inside input */
    .form-control + .toggle-password {
        position: absolute;
        right: 0.75rem;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: #ccc;
        cursor: pointer;
    }

        .form-control + .toggle-password:hover {
            color: #fff;
        }

    /* Form helper text */
    .form-text {
        color: #aaa;
    }
}
