* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gold: #B8860B;
    --light-gold: #DAA520;
    --rich-gold: #FFD700;
    --navy-blue: #1e3a8a;
    --dark-navy: #1e40af;
    --deep-blue: #0f172a;
    --cream: #fefcf3;
    --light-cream: #fffef9;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--cream) 0%, #f0f4f8 50%, var(--light-cream) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="islamic" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="1" fill="%23B8860B" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23islamic)"/></svg>');
    pointer-events: none;
    z-index: -1;
}

.auth-container {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 25px 60px var(--shadow-dark);
    overflow: hidden;
    width: 100%;
    max-width: 440px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-header {
    background: linear-gradient(135deg, var(--navy-blue) 0%, var(--dark-navy) 50%, var(--deep-blue) 100%);
    color: var(--white);
    padding: 50px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary-gold) 0%, transparent 70%);
    opacity: 0.08;
    animation: rotate 30s linear infinite;
}

.auth-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M50 5 L60 35 L90 35 L68 53 L78 83 L50 65 L22 83 L32 53 L10 35 L40 35 Z" fill="%23FFD700" opacity="0.03"/></svg>');
    background-size: 80px 80px;
    animation: float 6s ease-in-out infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.logo-section {
    margin-bottom: 25px;
    position: relative;
    z-index: 2;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-gold), var(--light-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--white);
    box-shadow: 0 15px 35px rgba(184, 134, 11, 0.4);
    position: relative;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--rich-gold);
    border-radius: 50%;
    opacity: 0.3;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, var(--white), var(--rich-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: 15px;
    opacity: 0.9;
    position: relative;
    z-index: 2;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.auth-form {
    padding: 45px 40px;
    background: var(--white);
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--white);
    font-family: 'Poppins', sans-serif;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-gold);
    box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.form-input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    font-size: 18px;
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 6px;
}

.password-toggle:hover {
    color: var(--primary-gold);
    background: rgba(184, 134, 11, 0.1);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.custom-checkbox {
    position: relative;
    width: 18px;
    height: 18px;
}

.checkbox {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background: var(--white);
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.checkbox:checked + .checkmark {
    background: var(--primary-gold);
    border-color: var(--primary-gold);
}

.checkmark::after {
    content: "";
    position: absolute;
    display: none;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox:checked + .checkmark::after {
    display: block;
}

.forgot-password, .auth-link {
    color: var(--navy-blue);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.forgot-password:hover, .auth-link:hover {
    color: var(--primary-gold);
    background: rgba(184, 134, 11, 0.1);
}

.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-gold), var(--light-gold));
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.3);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(184, 134, 11, 0.4);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.divider {
    text-align: center;
    margin: 35px 0;
    position: relative;
    color: var(--text-light);
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb, transparent);
}

.divider span {
    background: var(--white);
    padding: 0 20px;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.social-btn {
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
}

.social-btn:hover {
    border-color: var(--primary-gold);
    background: rgba(184, 134, 11, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.1);
}

.auth-footer {
    text-align: center;
    padding: 25px 30px;
    background: var(--cream);
    font-size: 14px;
    color: var(--text-light);
}

.field-error {
    color: var(--error);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.field-error.show {
    display: block;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.role-selector {
    margin-bottom: 25px;
}

.role-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.role-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.role-option {
    position: relative;
}

.role-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--white);
    text-align: center;
}

.role-card:hover {
    border-color: var(--primary-gold);
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.1);
}

.role-radio:checked + .role-card {
    border-color: var(--primary-gold);
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.05), rgba(218, 165, 32, 0.05));
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.2);
}

.role-icon {
    font-size: 20px;
    margin-bottom: 6px;
}

.role-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 3px;
}

.role-desc {
    font-size: 10px;
    color: var(--text-light);
    line-height: 1.2;
}

@media (max-width: 480px) {
    .auth-container {
        margin: 10px;
        border-radius: 20px;
    }
    
    .auth-header {
        padding: 40px 30px;
    }
    
    .auth-form {
        padding: 35px 30px;
    }
    
    .social-buttons {
        grid-template-columns: 1fr;
    }
    
    .role-options {
        grid-template-columns: 1fr;
    }
    
    .auth-title {
        font-size: 24px;
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}