/* tutorstarter-child/css/auth-popup.css */

:root {
    --iw-primary: #234e52;
    --iw-secondary: #7f1102;
    --iw-third: #d4a373;
    --iw-fourth: #a3be8c;
    --iw-light: #f8f5f0;
    --iw-error: #e53e3e;
    --iw-success: #38a169;
    --iw-border-radius: 12px;
    --iw-transition: all 0.3s ease;
}

/* --- Base Modal Styles --- */
.iw-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.iw-auth-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.iw-auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.iw-auth-modal-content {
    position: relative;
    z-index: 1001;
    width: 100%;
    max-width: 500px;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.iw-auth-modal.is-visible .iw-auth-modal-content {
    transform: translateY(0);
}

/* --- Card & Form Styles (from iw-login.css) --- */
.iw-login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--iw-border-radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    padding: 40px;
    width: 100%;
    position: relative;
    overflow: hidden; /* Hide overflowing content */
}

.iw-login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--iw-primary), var(--iw-secondary), var(--iw-third), var(--iw-fourth));
    border-radius: var(--iw-border-radius) var(--iw-border-radius) 0 0;
}

.iw-logo-container { text-align: center; margin-bottom: 30px; }
.iw-logo-bg { display: inline-block; background: white; padding: 15px; border-radius: 12px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); }
.iw-logo { height: 60px; width: auto; }
.iw-welcome-message { text-align: center; margin-bottom: 30px; }
.iw-arabic-greeting { font-family: 'Amiri', serif; font-size: 28px; color: var(--iw-primary); margin-bottom: 15px; font-weight: 700; }
.iw-welcome-text { color: var(--iw-secondary); font-size: 16px; line-height: 1.6; margin-bottom: 10px; }
.iw-login-form, .iw-register-form { margin-bottom: 20px; }
.iw-form-group { margin-bottom: 20px; position: relative; }
.iw-form-label { display: block; margin-bottom: 8px; color: var(--iw-primary); font-weight: 700; font-size: 14px; }
.iw-input-with-icon { position: relative; }
.iw-form-input, .iw-form-textarea { width: 100%; padding: 15px 15px 15px 45px; border: 2px solid var(--iw-third); border-radius: 10px; font-size: 16px; transition: var(--iw-transition); font-family: 'Philosopher', sans-serif; background: rgba(255, 255, 255, 0.9); }
.iw-form-input:focus, .iw-form-textarea:focus { outline: none; border-color: var(--iw-primary); box-shadow: 0 0 0 3px rgba(35, 78, 82, 0.2); background: white; }
.iw-input-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--iw-third); font-size: 18px; }
.iw-password-container { position: relative; }
.iw-password-toggle { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--iw-third); cursor: pointer; font-size: 18px; }
.iw-form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.iw-remember-me, .iw-forgot-password { margin-bottom: 0; }
.iw-forgot-password { text-align: right; }
.iw-forgot-password a { color: var(--iw-secondary); text-decoration: none; font-weight: 700; }
.iw-checkbox-label { display: flex; align-items: center; cursor: pointer; font-size: 16px; color: var(--iw-primary); }
.iw-checkbox-label input { display: none; }
.iw-checkbox-custom { width: 22px; height: 22px; border: 2px solid var(--iw-third); border-radius: 5px; margin-right: 8px; position: relative; }
.iw-checkbox-label input:checked + .iw-checkbox-custom { border-color: var(--iw-primary); background-color: var(--iw-primary); }
.iw-checkbox-label input:checked + .iw-checkbox-custom::after { content: '✓'; color: white; font-weight: bold; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.iw-form-button { width: 100%; padding: 18px; background: linear-gradient(135deg, var(--iw-primary) 0%, var(--iw-secondary) 100%); color: white; border: none; border-radius: 10px; font-size: 18px; font-weight: 700; cursor: pointer; transition: var(--iw-transition); font-family: 'Philosopher', sans-serif; display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; }
.iw-button-loader { display: none; position: absolute; right: 15px; }
.iw-loader-spinner { width: 20px; height: 20px; border: 2px solid transparent; border-top: 2px solid white; border-radius: 50%; animation: iw-spin 0.8s linear infinite; }
.iw-login-footer { text-align: center; color: var(--iw-primary); margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(212, 163, 115, 0.3); }
.iw-login-footer a { color: var(--iw-secondary); font-weight: 700; text-decoration: none; }
.iw-form-error { padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; background-color: rgba(229, 62, 62, 0.1); border-left: 4px solid var(--iw-error); color: var(--iw-error); }
.iw-input-error { border-color: var(--iw-error) !important; }
.iw-loading .iw-button-text { visibility: hidden; }
.iw-loading .iw-button-loader { display: block; }

/* --- Registration Form Specific Styles --- */
.iw-register-card { max-width: 900px; }
.iw-form-section { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid rgba(212, 163, 115, 0.3); }
.iw-form-section:last-of-type { border-bottom: none; margin-bottom: 20px; padding-bottom: 0; }
.iw-form-row { gap: 15px; }
.iw-form-group { flex: 1; }
.iw-input-with-prefix { position: relative; display: flex; align-items: center; }
.iw-input-prefix { position: absolute; left: 15px; color: var(--iw-primary); font-weight: bold; z-index: 2; }
.iw-input-with-prefix .iw-form-input { padding-left: 55px; }
.iw-radio-group { display: flex; gap: 20px; }
.iw-radio-label { display: flex; align-items: center; cursor: pointer; }
.iw-radio-label input { display: none; }
.iw-radio-custom { width: 22px; height: 22px; border: 2px solid var(--iw-third); border-radius: 50%; margin-right: 8px; position: relative; }
.iw-radio-label input:checked + .iw-radio-custom { border-color: var(--iw-primary); }
.iw-radio-label input:checked + .iw-radio-custom::after { content: ''; width: 12px; height: 12px; background: var(--iw-primary); border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.iw-form-terms a { color: var(--iw-secondary); font-weight: 700; }

/* --- Form View Toggling --- */
.iw-auth-view { display: none; }
.iw-auth-view.is-active { display: block; }

@keyframes iw-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- Add these styles to the end of the file --- */
.iw-auth-modal-content {
    max-height: 90vh; /* Limit the height to 90% of the viewport height */
    overflow-y: auto;  /* Add a vertical scrollbar only when needed */
    scrollbar-width: thin;
    scrollbar-color: var(--iw-third) rgba(212, 163, 115, 0.1);
}

.iw-auth-modal-content::-webkit-scrollbar {
    width: 6px;
}

.iw-auth-modal-content::-webkit-scrollbar-track {
    background: rgba(212, 163, 115, 0.1);
    border-radius: 10px;
}

.iw-auth-modal-content::-webkit-scrollbar-thumb {
    background: var(--iw-third);
    border-radius: 10px;
}

/* --- ADDED: Styles for the Registration Form Section Title --- */
.iw-form-section-title {
    font-size: 18px;
    color: var(--iw-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--iw-third);
    position: relative;
    display: inline-block;
}

.iw-form-section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--iw-secondary);
}

