/* ============================================
   Auth Pages - Islamic Design System
   ============================================ */

/* Islamic Geometric Background */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0d9488 0%, #065f46 50%, #064e3b 100%);
    padding: 2rem 1rem;
}

.auth-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M40 0L80 40L40 80L0 40z'/%3E%3Cpath d='M40 10L70 40L40 70L10 40z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: patternDrift 30s linear infinite;
}

@keyframes patternDrift {
    0% { background-position: 0 0; }
    100% { background-position: 80px 80px; }
}

.auth-page::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, transparent 70%);
    animation: glowRotate 20s linear infinite;
}

@keyframes glowRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Auth Card */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    padding: 2.5rem;
    animation: cardEnter 0.6s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Islamic Decoration Top */
.auth-card .islamic-top {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card .islamic-top .icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #0d9488, #065f46);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.35);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { box-shadow: 0 8px 30px rgba(13, 148, 136, 0.35); }
    50% { box-shadow: 0 8px 40px rgba(13, 148, 136, 0.55); }
}

.auth-card .islamic-top .icon-circle i {
    font-size: 2rem;
    color: #fcd34d;
}

.auth-card .islamic-top .bismillah {
    font-family: 'Amiri', serif;
    font-size: 1.5rem;
    color: #0d9488;
    margin-bottom: 0.25rem;
}

.auth-card .islamic-top h1 {
    font-family: 'Cairo', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}

.auth-card .islamic-top .subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Islamic Divider */
.islamic-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.islamic-divider::before,
.islamic-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.islamic-divider i {
    color: #d4af37;
    font-size: 0.875rem;
}

/* Form Styles */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.auth-form .form-group label i {
    margin-left: 0.25rem;
    color: #0d9488;
}

.auth-form .input-wrapper {
    position: relative;
}

.auth-form .input-wrapper i.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    transition: color 0.3s;
    pointer-events: none;
}

.auth-form .input-wrapper input,
.auth-form .input-wrapper select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 1rem;
    padding-right: 2.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    color: #1e293b;
    background: #f8fafc;
    transition: all 0.3s;
    outline: none;
}

.auth-form .input-wrapper input:focus,
.auth-form .input-wrapper select:focus {
    border-color: #0d9488;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.1);
}

.auth-form .input-wrapper input:focus + i.input-icon,
.auth-form .input-wrapper input:focus ~ i.input-icon {
    color: #0d9488;
}

/* Role Selection */
.role-selection {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.role-card {
    position: relative;
    cursor: pointer;
}

.role-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.role-card .role-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    background: #f8fafc;
    transition: all 0.3s;
    text-align: center;
}

.role-card .role-content i {
    font-size: 1.75rem;
    color: #94a3b8;
    transition: color 0.3s;
}

.role-card .role-content span {
    font-weight: 600;
    color: #64748b;
    font-size: 0.875rem;
    transition: color 0.3s;
}

.role-card input[type="radio"]:checked + .role-content {
    border-color: #0d9488;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.05), rgba(13, 148, 136, 0.1));
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.15);
}

.role-card input[type="radio"]:checked + .role-content i {
    color: #0d9488;
}

.role-card input[type="radio"]:checked + .role-content span {
    color: #0d9488;
}

/* Submit Button */
.auth-form .btn-auth {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #0d9488, #065f46);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-form .btn-auth::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-form .btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(13, 148, 136, 0.35);
}

.auth-form .btn-auth:hover::before {
    opacity: 1;
}

.auth-form .btn-auth:active {
    transform: translateY(0);
}

.auth-form .btn-auth.loading {
    pointer-events: none;
    opacity: 0.8;
}

.auth-form .btn-auth .spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.auth-form .btn-auth.loading .spinner {
    display: block;
}

.auth-form .btn-auth.loading .btn-text {
    display: none;
}

/* Auth Links */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    color: #64748b;
    font-size: 0.9rem;
}

.auth-links a {
    color: #0d9488;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}

.auth-links a:hover {
    color: #065f46;
    text-decoration: underline;
}

/* Alert Messages */
.auth-alert {
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
    animation: alertSlide 0.3s ease-out;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-alert.show {
    display: flex;
}

.auth-alert.success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.auth-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Floating Islamic Ornaments */
.auth-ornament {
    position: absolute;
    pointer-events: none;
    z-index: 5;
}

.auth-ornament.top-left {
    top: 2rem;
    left: 2rem;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.08);
    animation: float 4s ease-in-out infinite;
}

.auth-ornament.bottom-right {
    bottom: 2rem;
    right: 2rem;
    font-size: 5rem;
    color: rgba(212, 175, 55, 0.1);
    animation: float 5s ease-in-out infinite reverse;
}

.auth-ornament.center-star {
    top: 50%;
    left: 10%;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.05);
    animation: float 6s ease-in-out infinite 1s;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    transition: color 0.3s;
    z-index: 2;
}

.password-toggle:hover {
    color: #0d9488;
}

/* ============================================
   Dark Mode
   ============================================ */
[data-theme="dark"] .auth-card {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(71, 85, 105, 0.3);
}

[data-theme="dark"] .auth-card .islamic-top .bismillah {
    color: #5eead4;
}

[data-theme="dark"] .auth-card .islamic-top h1 {
    color: #f1f5f9;
}

[data-theme="dark"] .auth-card .islamic-top .subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .auth-form .form-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .auth-form .input-wrapper input,
[data-theme="dark"] .auth-form .input-wrapper select {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

[data-theme="dark"] .auth-form .input-wrapper input:focus,
[data-theme="dark"] .auth-form .input-wrapper select:focus {
    border-color: #14b8a6;
    background: #1e293b;
}

[data-theme="dark"] .role-card .role-content {
    background: #334155;
    border-color: #475569;
}

[data-theme="dark"] .role-card .role-content span {
    color: #cbd5e1;
}

[data-theme="dark"] .role-card input[type="radio"]:checked + .role-content {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.2));
    border-color: #14b8a6;
}

[data-theme="dark"] .auth-links {
    color: #94a3b8;
}

[data-theme="dark"] .auth-links a {
    color: #5eead4;
}

[data-theme="dark"] .auth-alert.success {
    background: rgba(6, 95, 70, 0.2);
    border-color: rgba(167, 243, 208, 0.2);
    color: #a7f3d0;
}

[data-theme="dark"] .auth-alert.error {
    background: rgba(153, 27, 27, 0.2);
    border-color: rgba(254, 202, 202, 0.2);
    color: #fecaca;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .auth-page {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: 1.25rem;
    }

    .auth-card .islamic-top .icon-circle {
        width: 64px;
        height: 64px;
    }

    .auth-card .islamic-top .icon-circle i {
        font-size: 1.5rem;
    }

    .auth-card .islamic-top .bismillah {
        font-size: 1.25rem;
    }

    .auth-card .islamic-top h1 {
        font-size: 1.25rem;
    }

    .role-selection {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .role-card .role-content {
        padding: 1rem 0.5rem;
    }

    .role-card .role-content i {
        font-size: 1.5rem;
    }

    .auth-ornament {
        display: none;
    }
}

@media (max-width: 360px) {
    .auth-card {
        padding: 1.5rem 1rem;
    }

    .auth-card .islamic-top h1 {
        font-size: 1.1rem;
    }
}
