/* =============================================================
   ROLLERSHUUTERS ATTENDANCE - AUTH PAGES CSS
   Professional login & forgot-password styling
   ============================================================= */

/* =========================
   CSS VARIABLES / THEME
   ========================= */
:root {
    --primary:       #1a56db;
    --primary-dark:  #1040a0;
    --primary-light: #e8edfb;
    --accent:        #f97316;
    --accent-hover:  #ea580c;
    --success:       #10b981;
    --danger:        #ef4444;
    --warning:       #f59e0b;

    --bg-body:       #f0f2f5;
    --bg-card:       #ffffff;
    --text-primary:  #1f2937;
    --text-secondary:#6b7280;
    --text-muted:    #9ca3af;
    --border:        #e5e7eb;
    --border-focus:  #1a56db;

    --shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg:     0 10px 40px rgba(0,0,0,0.1);
    --shadow-xl:     0 20px 60px rgba(0,0,0,0.12);

    --radius-sm:     6px;
    --radius-md:     10px;
    --radius-lg:     16px;
    --radius-xl:     20px;

    --font-family:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================
   RESET & BASE
   ========================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.auth-body {
    font-family: var(--font-family);
    background: var(--bg-body);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* =========================
   BACKGROUND DECORATION
   ========================= */
.auth-body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -30%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(26,86,219,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.auth-body::after {
    content: '';
    position: fixed;
    bottom: -40%;
    left: -20%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(249,115,22,0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

/* =========================
   AUTH CONTAINER
   ========================= */
.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}

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

/* =========================
   AUTH CARD
   ========================= */
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px 36px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

/* Top accent line */
.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* =========================
   AUTH HEADER
   ========================= */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(26,86,219,0.3);
}

.auth-logo i {
    font-size: 28px;
    color: #ffffff;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto;
}

/* =========================
   FORM GROUPS
   ========================= */
.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.auth-form .form-label i {
    color: var(--primary);
    font-size: 0.75rem;
}

/* =========================
   INPUT WRAPPER
   ========================= */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: var(--transition);
    pointer-events: none;
    z-index: 1;
}

.input-wrapper .form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 42px;
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-body);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: var(--transition);
}

/* Password field extra right padding for toggle button */
.input-wrapper .toggle-password ~ .form-control,
.has-toggle .form-control {
    padding-right: 46px;
}

.input-wrapper .form-control::placeholder {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.input-wrapper .form-control:focus {
    border-color: var(--border-focus);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}

.input-wrapper .form-control:focus + .input-icon,
.input-wrapper .form-control:focus ~ .input-icon {
    color: var(--primary);
}

/* Fix: icon is before input in HTML, so use ~ sibling */
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

/* =========================
   TOGGLE PASSWORD BUTTON
   ========================= */
.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 4px;
    transition: var(--transition);
    z-index: 1;
}

.toggle-password:hover {
    color: var(--primary);
}

/* =========================
   INPUT VALIDATION STATES
   ========================= */
.form-group.has-error .input-wrapper .form-control,
.auth-form .form-control.is-invalid {
    border-color: var(--danger);
    background: #fef2f2;
}

.form-group.has-error .input-icon,
.auth-form .form-control.is-invalid ~ .input-icon {
    color: var(--danger) !important;
}

.invalid-feedback {
    display: block;
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 5px;
    padding-left: 4px;
}

/* =========================
   REMEMBER ME + FORGOT PASS
   ========================= */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.remember-me {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    user-select: none;
    gap: 8px;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.remember-me .checkmark {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.remember-me input[type="checkbox"]:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me input[type="checkbox"]:checked + .checkmark::after {
    content: '\2713';
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}

.forgot-link {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =========================
   LOGIN BUTTON
   ========================= */
.btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,86,219,0.35);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* =========================
   BACK TO LOGIN LINK
   ========================= */
.back-to-login {
    text-align: center;
    margin-top: 16px;
}

.back-to-login a {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.back-to-login a:hover {
    color: var(--primary);
}

/* =========================
   AUTH FOOTER
   ========================= */
.auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.auth-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =========================
   FLASH / ALERT MESSAGES
   ========================= */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 440px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-family: var(--font-family);
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert .btn-close {
    margin-left: auto;
    opacity: 0.5;
    cursor: pointer;
}

.alert .btn-close:hover {
    opacity: 1;
}

.alert.fade-out {
    animation: fadeOut 0.5s ease-in forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */
@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-card {
        padding: 28px 24px;
        border-radius: var(--radius-lg);
    }

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

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .alert {
        left: 16px;
        right: 16px;
        min-width: auto;
        max-width: none;
    }
}

/* =========================
   UTILITY: Focus visible
   ========================= */
.form-control:focus-visible,
.btn-login:focus-visible,
.btn-submit:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* =========================
   PASSWORD STRENGTH
   ========================= */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    margin-bottom: 4px;
}
.strength-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease, background 0.3s ease;
}
.strength-text {
    font-size: 0.6875rem;
    font-weight: 600;
    min-width: 70px;
    text-align: right;
}

/* =========================
   ALERT WARNING (for reset)
   ========================= */
.alert-warning {
    background: #fff7ed;
    color: #92400e;
    border: 1px solid #fbbf24;
}

/* =========================
   SUBMIT BUTTON (reset page)
   ========================= */
.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,86,219,0.35);
}
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}
