/* ============================================================
   UFUQ Quran LMS - Authentication Pages
   Standalone login, register, forgot-password styling
   Islamic geometric pattern background
   ============================================================ */

/* ----- Auth Body & Wrapper (AuthLayout) ----- */
.auth-body {
    background: linear-gradient(135deg, #0D4A32 0%, #1B6B4A 40%, #0D4A32 100%);
    min-height: 100vh;
}

.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-bg-pattern {
    width: 100%;
    height: 100%;
    opacity: 0.06;
    background-image:
        linear-gradient(30deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(150deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(30deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(150deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(60deg, #D4BC7E 25%, transparent 25.5%, transparent 75%, #D4BC7E 75%, #D4BC7E),
        linear-gradient(60deg, #D4BC7E 25%, transparent 25.5%, transparent 75%, #D4BC7E 75%, #D4BC7E);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
}

.auth-wrapper {
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 1rem;
}

.auth-container .auth-card {
    animation: authCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ----- Auth Page Container (standalone) ----- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0D4A32 0%, #1B6B4A 40%, #0D4A32 100%);
}

/* ----- Islamic Geometric Pattern Overlay ----- */
.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.06;
    background-image:
        linear-gradient(30deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(150deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(30deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(150deg, #C8A961 12%, transparent 12.5%, transparent 87%, #C8A961 87.5%, #C8A961),
        linear-gradient(60deg, #D4BC7E 25%, transparent 25.5%, transparent 75%, #D4BC7E 75%, #D4BC7E),
        linear-gradient(60deg, #D4BC7E 25%, transparent 25.5%, transparent 75%, #D4BC7E 75%, #D4BC7E);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
    pointer-events: none;
    z-index: 0;
}

.auth-page::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(200, 169, 97, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ----- Auth Card ----- */
.auth-card {
    width: 100%;
    max-width: 450px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 2.5rem 2.5rem 2rem;
    position: relative;
    z-index: 1;
    animation: authCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes authCardIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1B6B4A, #2E8B65, #C8A961);
    border-radius: 24px 24px 0 0;
}

/* ----- Auth Icon Circle ----- */
.auth-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1B6B4A 0%, #2E8B65 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(27, 107, 74, 0.3);
}

/* ----- Auth Brand (in AuthLayout) ----- */
.auth-brand-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary, #1B6B4A);
    margin-bottom: 0;
}

.auth-brand-subtitle {
    font-size: 0.85rem;
    color: var(--secondary, #C8A961);
    font-weight: 600;
}

/* ----- Auth Logo ----- */
.auth-logo {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1B6B4A 0%, #2E8B65 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 0.75rem;
    box-shadow: 0 8px 24px rgba(27, 107, 74, 0.3);
}

.auth-logo .logo-text {
    font-family: var(--font-ui, 'Noto Kufi Arabic', sans-serif);
    font-size: 1.4rem;
    font-weight: 800;
    color: #1B6B4A;
    letter-spacing: -0.01em;
}

.auth-logo .logo-subtitle {
    font-size: 0.78rem;
    color: #C8A961;
    font-weight: 600;
}

/* ----- Auth Title ----- */
.auth-title {
    font-family: var(--font-ui, 'Noto Kufi Arabic', sans-serif);
    font-size: 1.35rem;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 1.75rem;
    font-weight: 400;
}

/* ----- Auth Form ----- */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #1a1a2e;
    margin-bottom: 0.4rem;
}

.auth-form .form-control {
    padding: 0.75rem 1.1rem;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    font-size: 0.92rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
}

.auth-form .form-control:focus {
    border-color: #1B6B4A;
    box-shadow: 0 0 0 3px rgba(27, 107, 74, 0.1);
    background: #ffffff;
}

.auth-form .form-control::placeholder {
    color: #9ca3af;
}

.auth-form .input-group {
    position: relative;
}

.auth-form .input-group .input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 1rem;
    z-index: 5;
    pointer-events: none;
}

.auth-form .input-group .form-control {
    padding-right: 2.8rem;
}

.auth-form .password-toggle {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1rem;
    z-index: 5;
    padding: 0;
    transition: color 0.2s ease;
}

.auth-form .password-toggle:hover {
    color: #1B6B4A;
}

/* ----- Auth Button ----- */
.auth-btn {
    width: 100%;
    padding: 0.8rem 1.5rem;
    font-family: var(--font-ui, 'Noto Kufi Arabic', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1B6B4A 0%, #2E8B65 100%);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(27, 107, 74, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-btn:hover {
    background: linear-gradient(135deg, #0D4A32 0%, #1B6B4A 100%);
    box-shadow: 0 6px 30px rgba(27, 107, 74, 0.4);
    transform: translateY(-1px);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(27, 107, 74, 0.3);
}

.auth-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.auth-btn .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

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

/* ----- Auth Links ----- */
.auth-link {
    color: #C8A961;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: #A88B3D;
    text-decoration: underline;
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.auth-options .form-check-label {
    font-weight: 500;
    color: #6b7280;
}

/* ----- Auth Divider ----- */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    font-size: 0.78rem;
    font-weight: 600;
    color: #9ca3af;
    white-space: nowrap;
}

/* ----- Auth Footer ----- */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.85rem;
    color: #6b7280;
}

.auth-footer a {
    color: #1B6B4A;
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #0D4A32;
    text-decoration: underline;
}

/* ----- Auth Error Messages ----- */
.auth-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #dc2626;
    font-weight: 500;
}

.auth-success {
    background: rgba(27, 107, 74, 0.08);
    border: 1px solid rgba(27, 107, 74, 0.15);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: #1B6B4A;
    font-weight: 500;
}

/* ----- Floating Decoration ----- */
.auth-page .auth-decoration {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}

.auth-page .auth-decoration.top-left {
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200, 169, 97, 0.1) 0%, transparent 70%);
}

.auth-page .auth-decoration.bottom-right {
    bottom: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 139, 101, 0.08) 0%, transparent 70%);
}

/* ----- Responsive ----- */
@media (max-width: 576px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 3rem;
    }

    .auth-card {
        padding: 2rem 1.5rem 1.5rem;
        border-radius: 20px;
    }

    .auth-logo .logo-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }

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