@import url('./base.css?v=20260721c');

/* Auth branding variables. Defaults reproduce the platform look exactly; on a
   teacher subdomain, auth-branding.js overwrites them from the teacher's saved
   colours. Every background is a two-stop gradient (page-builder convention).*/
:root {
    --auth-page-bg-1: var(--accent-color);
    --auth-page-bg-2: var(--secondary-color);
    --auth-header-bg-1: var(--accent-color);
    --auth-header-bg-2: var(--secondary-color);
    --auth-header-text: var(--white);
    --auth-card: var(--white);
    --auth-text: var(--text-primary);
    --auth-accent: var(--accent-color);
    --auth-button-1: var(--secondary-color);
    --auth-button-2: var(--secondary-color);
    --auth-button-text: var(--white);
}

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, var(--auth-page-bg-1), var(--auth-page-bg-2));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

/* The auth pages have no topbar and load none of site.css's .theme-toggle
   chrome, so the visitor language toggle is fully self-styled here, floating
   over the gradient background. */
.auth-lang-toggle {
    position: fixed;
    top: 1.25rem;
    inset-inline-end: 1.25rem;
    z-index: 10;
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.auth-lang-toggle:hover { background: rgba(255, 255, 255, 0.3); }

/* =========================================================
   COMMON STYLES (Shared between .container and .register-container)
========================================================= */
.container,
.register-container {
    background: var(--auth-card);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 450px;
    position: relative;
}

/* HEADER (Common) */
.header,
.register-header {
    background: linear-gradient(135deg, var(--auth-header-bg-1), var(--auth-header-bg-2));
    color: var(--auth-header-text);
    padding: 2rem;
    text-align: center;
}

/* Teacher logo, injected by auth-branding.js only on a branded subdomain. */
.auth-logo {
    display: block;
    margin: 0 auto 1rem;
    max-width: 100%;
    object-fit: contain;
}

.header h1,
.register-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header p,
.register-header p {
    opacity: 0.9;
    font-size: 1rem;
}

/* FORM (Common) */
.form,
.register-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--dark-gray);
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    background: var(--white);
    color: var(--accent-color);
}

.form-input:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(170, 198, 93, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* ACCOUNT TYPE SELECTOR (Common) */
.account-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.account-type-option {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--dark-gray);
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    background: var(--white);
}

.account-type-option:hover {
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.account-type-option.selected {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: var(--white);
}

.account-type-option i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* BUTTON (Common) */
.button,
.register-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--auth-button-1), var(--auth-button-2));
    color: var(--auth-button-text);
    border: none;
    border-radius: 10px;
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    margin-bottom: 1rem;
}

.button:hover,
.register-button:hover {
    background: linear-gradient(135deg, var(--auth-button-2), var(--auth-button-1));
    transform: translateY(-2px);
}

.button:disabled,
.register-button:disabled {
    background: var(--dark-gray);
    cursor: not-allowed;
    transform: none;
}

/* FOOTER (Common) */
.footer,
.register-footer {
    text-align: center;
    padding: 1rem 2rem 2rem;
    border-top: 1px solid var(--light-gray);
}

.footer a,
.register-footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer a:hover,
.register-footer a:hover {
    color: var(--accent-color);
}

.legal-links {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.legal-links a {
    color: inherit;
}

.legal-links span {
    margin: 0 0.4rem;
}

/* LOADING SPINNER + SUCCESS MESSAGE (Common) */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--white);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.loading-spinner.show {
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    background: var(--success-color);
    color: var(--white);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
}

/* =========================================================
   REGISTER-SPECIFIC DIFFERENCES
========================================================= */
.register-container {
    max-width: 500px;
}

.register-form {
    padding: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.password-requirements {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--accent-color);
}

.password-requirements h4 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.password-requirements ul {
    list-style: none;
    padding: 0;
}

.password-requirements li {
    margin-bottom: 0.3rem;
    padding-right: 1.5rem;
    position: relative;
}

.password-requirements li::before {
    content: '✓';
    position: absolute;
    right: 0;
    color: var(--success-color);
    font-weight: bold;
}

.password-requirements li.invalid::before {
    content: '✗';
    color: var(--error-color);
}

/* PASSWORD TOGGLE (Common) */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-input {
    padding-left: 3rem;
}

.password-toggle {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent-color);
    font-size: 1rem;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.password-toggle:hover {
    opacity: 1;
}

/* =========================================================
   RESPONSIVE DESIGN
========================================================= */
@media (max-width: 480px) {
    body {
        padding: 1rem;
    }

    .container,
    .register-container {
        border-radius: 15px;
    }

    .header,
    .register-header {
        padding: 1.5rem;
    }

    .header h1,
    .register-header h1 {
        font-size: 1.5rem;
    }

    .form,
    .register-form {
        padding: 1.5rem;
    }

    .account-type-selector {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}


/**/
/* ===== رسائل توجيهية للمستخدمين الجدد ===== */
.welcome-tip {
    border-radius: var(--border-radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    position: relative;
    animation: slideDown 0.5s ease-out;
    transition: var(--transition);
}

.welcome-tip.hidden {
    display: none;
}

/* === رسالة الطلاب === */
.student-tip {
    background: linear-gradient(135deg, rgba(19, 121, 128, 0.08) 0%, rgba(19, 121, 128, 0.15) 100%);
    border: 1px solid var(--accent-color);
    box-shadow: var(--shadow);
}

/* === رسالة المعلمين === */
.teacher-tip {
    background: linear-gradient(135deg, rgba(170, 198, 93, 0.1) 0%, rgba(170, 198, 93, 0.2) 100%);
    border: 1px solid var(--secondary-color);
    box-shadow: var(--shadow);
}

.tip-content {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* === أيقونات الرسائل === */
.tip-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

.student-icon {
    background: linear-gradient(135deg, var(--accent-color), #0d5a5f);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(19, 121, 128, 0.4);
}

.teacher-icon {
    background: linear-gradient(135deg, var(--secondary-color), #8ba83f);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(170, 198, 93, 0.4);
}

/* === النص === */
.tip-text {
    flex: 1;
    min-width: 200px;
}

.student-tip .tip-text strong {
    color: var(--accent-color);
    font-size: 1rem;
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.teacher-tip .tip-text strong {
    color: #7a9a35;
    font-size: 1rem;
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}

.tip-text p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* === زر اليوتيوب === */
.tip-link.youtube-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff0000, #cc0000);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
    white-space: nowrap;
}

.tip-link.youtube-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.4);
    text-decoration: none;
}

.tip-link.youtube-btn i {
    font-size: 1.3rem;
    animation: pulse 1.5s infinite;
}

/* === زر الإغلاق === */
.tip-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--hover-bg);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 0.9rem;
}

.tip-close:hover {
    background: rgba(220, 53, 69, 0.15);
    color: var(--error-color);
    transform: rotate(90deg);
}

/* === الأنيميشن === */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ===== 🌙 Dark Mode Support ===== */
[data-theme="dark"] .student-tip {
    background: linear-gradient(135deg, rgba(74, 155, 165, 0.1) 0%, rgba(74, 155, 165, 0.2) 100%);
    border-color: var(--accent-color);
}

[data-theme="dark"] .teacher-tip {
    background: linear-gradient(135deg, rgba(139, 168, 63, 0.1) 0%, rgba(139, 168, 63, 0.2) 100%);
    border-color: var(--secondary-color);
}

[data-theme="dark"] .student-tip .tip-text strong {
    color: #5dbfc9;
}

[data-theme="dark"] .teacher-tip .tip-text strong {
    color: var(--secondary-color);
}

[data-theme="dark"] .student-icon {
    background: linear-gradient(135deg, var(--accent-color), #367b82);
}

[data-theme="dark"] .teacher-icon {
    background: linear-gradient(135deg, var(--secondary-color), #6d8a2f);
}

[data-theme="dark"] .tip-close {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

[data-theme="dark"] .tip-close:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
}

/* === Responsive === */
@media (max-width: 768px) {
    .welcome-tip {
        padding: 15px;
    }

    .tip-content {
        flex-direction: column;
        text-align: center;
    }

    .tip-text {
        text-align: center;
    }

    .tip-link.youtube-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }

    .tip-close {
        top: 8px;
        left: 8px;
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .tip-icon {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .tip-text strong {
        font-size: 0.95rem !important;
    }

    .tip-text p {
        font-size: 0.85rem;
    }

    .tip-link.youtube-btn {
        font-size: 0.9rem;
        padding: 12px 18px;
    }
}

/* ============================================
   Device Limit Error Styles
   ============================================ */

.device-limit-error {
    display: none;
    margin-top: 20px;
    animation: slideDown 0.4s ease;
}

.device-limit-error.show {
    display: block;
}

.device-limit-error-content {
    background: linear-gradient(135deg, #fff5f5, #fff0f0);
    border: 2px solid #e74c3c;
    border-radius: 16px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.15);
}

[data-theme="dark"] .device-limit-error-content {
    background: linear-gradient(135deg, #3d1f1f, #352020);
    border-color: #c0392b;
}

.device-limit-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.device-limit-icon i {
    font-size: 2rem;
    color: #e74c3c;
    animation: pulse 2s infinite;
}

.device-limit-error-content h3 {
    color: #c0392b;
    font-size: 1.15rem;
    margin: 0 0 10px;
    font-weight: 700;
}

[data-theme="dark"] .device-limit-error-content h3 {
    color: #e74c3c;
}

.device-limit-error-content p {
    color: #555;
    font-size: 0.95rem;
    margin: 0 0 16px;
    line-height: 1.6;
}

[data-theme="dark"] .device-limit-error-content p {
    color: #ccc;
}

.device-limit-hint {
    background: rgba(231, 76, 60, 0.06);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 0.85rem;
    color: #888;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: right;
    line-height: 1.6;
}

[data-theme="dark"] .device-limit-hint {
    background: rgba(231, 76, 60, 0.1);
    color: #aaa;
}

.device-limit-hint i {
    color: #e67e22;
    margin-top: 3px;
    flex-shrink: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .device-limit-error-content {
        padding: 20px 16px;
    }

    .device-limit-error-content h3 {
        font-size: 1.05rem;
    }

    .device-limit-hint {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 6px;
    }
}
/* ================== TEACHER CONTACT LINKS (auth pages) ================== */
.auth-contacts {
    padding: 1.25rem 2rem 1.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
}

.auth-contacts-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-text);
    opacity: 0.75;
    margin-bottom: 0.85rem;
}

.auth-contacts-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.auth-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--auth-accent);
    border-radius: 25px;
    color: var(--auth-accent);
    background: transparent;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
}

.auth-contact-item:hover {
    background: var(--auth-accent);
    color: var(--auth-card);
    transform: translateY(-2px);
}
