/* 
 * Premium Visitor Authentication CSS (Hero Layout)
 * Integrates directly with Yemen Library Main Aesthetics
 */

:root {
    --auth-primary: var(--primary-blue, #2B7DC3);
    --auth-bg: #F8FAFC; 
    --auth-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    --auth-radius: 20px;
    --text-main: #2D3748;
    --text-muted: #718096;
    --border-color: #E2E8F0;
    --input-bg: #FFFFFF;
}

body.visitor-bg {
    background-color: var(--auth-bg);
}

.visitor-container {
    padding-top: 1rem;
    padding-bottom: 4rem;
    max-width: 1200px;
}

/* Auth Hero Design (Mirrors Profile Layout) */
.auth-hero-container {
    position: relative;
    margin-top: 20px;
    margin-bottom: 50px;
    z-index: 1;
    width: 100%;
}

.auth-hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 350px;
    background: linear-gradient(145deg, var(--auth-primary), #4299E1);
    border-radius: var(--auth-radius);
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.auth-hero-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg opacity="0.05" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="white"/></svg>') repeat;
    background-size: 200px;
    z-index: 1;
}

.auth-card {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 92%;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px 30px 40px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    transform: translateY(60px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.auth-avatar-container {
    position: relative;
    margin-top: -70px;
    margin-bottom: 20px;
    display: inline-block;
}

.auth-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 8px 25px rgba(43, 125, 195, 0.4);
    background: linear-gradient(135deg, var(--auth-primary), #4299E1);
    color: white;
    font-size: 2.5rem;
}

.auth-form-title {
    font-size: 1.8rem;
    color: var(--auth-primary);
    margin-bottom: 0.5rem;
    font-weight: 800;
    text-align: center;
}

.auth-form-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    text-align: center;
}

.auth-form-content {
    width: 100%;
}

.auth-form-content form {
    margin-bottom: 1.5rem;
}

/* Fields */
.visitor-field-group {
    margin-bottom: 1.2rem;
}

.visitor-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
}

.visitor-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 1.1rem;
    z-index: 2;
}

.visitor-input {
    width: 100%;
    padding: 0.8rem 2.8rem 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.visitor-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(43, 125, 195, 0.1);
}

.password-toggle {
    position: absolute;
    left: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 2;
    padding: 5px;
}

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

/* Submit Button */
.visitor-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--auth-primary), #4299E1);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.9rem;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(43, 125, 195, 0.2);
    margin-top: 1rem;
}

.visitor-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(43, 125, 195, 0.3);
}

/* Auth Options & Links */
.auth-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.forgot-pass-link, .visitor-alt-link a, .visitor-alt-link span {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-pass-link:hover, .visitor-alt-link:hover span {
    color: #1e5a8f;
    text-decoration: underline;
}

.visitor-alt-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    z-index: 10;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.8rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 1rem;
}

.google-auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: #FFFFFF;
    border: 1px solid #DADCE0;
    border-radius: 12px;
    padding: 0.6rem;
    text-decoration: none;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.google-auth-btn:hover {
    background-color: #F8F9FA;
    box-shadow: 0 1px 3px rgba(60,64,67,0.3);
}

.google-icon-wrapper {
    background: #fff;
    border-radius: 50%;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
}

.google-svg {
    width: 20px;
    height: 20px;
}

.google-text {
    font-family: 'Roboto', 'Tajawal', sans-serif;
    color: #3C4043;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.25px;
}

/* Alerts */
.alert-box {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.alert-success {
    background-color: #F0FDF4;
    color: #16A34A;
    border: 1px solid #86EFAC;
}

.alert-box i {
    margin-left: 10px;
    font-size: 1.2rem;
}

/* Password Strength Bar */
.password-strength-container {
    margin-bottom: 1.5rem;
    margin-top: 5px;
}
.strength-bar {
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}
.strength-fill {
    height: 100%;
    width: 0;
    transition: width 0.3s ease, background-color 0.3s ease;
}
.strength-weak { background-color: #ef4444; width: 33.33%; }
.strength-medium { background-color: #f59e0b; width: 66.66%; }
.strength-strong { background-color: #10b981; width: 100%; }
.strength-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Multiple Fields Row */
.name-fields-row {
    display: flex;
    gap: 15px;
}
.name-fields-row .visitor-field-group {
    flex: 1;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .auth-hero-bg {
        height: 240px;
    }
    .auth-card {
        width: 96%;
        padding: 15px 15px 25px;
        transform: translateY(30px);
    }
    .auth-avatar-container {
        margin-top: -60px;
        margin-bottom: 10px;
    }
    .auth-avatar {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }
    .auth-form-title {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    .auth-form-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }
    .visitor-field-group {
        margin-bottom: 0.9rem;
    }
    .visitor-input {
        padding: 0.7rem 2.5rem 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
    .visitor-submit-btn {
        padding: 0.7rem;
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    .name-fields-row {
        flex-direction: column;
        gap: 0;
    }
    .auth-options {
        margin-bottom: 1rem;
    }
    .visitor-container {
        padding-bottom: 2rem;
    }
}
