/* ===================================================================
   Auth StyleSheet — Tanta Study Hub
   Adapted from React/Tailwind Showcase
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #f8fafc;
    /* slate-50 */
    --text-main: #0f172a;
    /* slate-900 */
    --text-muted: #475569;
    /* slate-600 */
    --text-faint: #94a3b8;
    /* slate-400 */
    --border-color: #e2e8f0;
    /* slate-200 */
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: #e2e8f0;

    --pattern-fill-left: #cbd5e1;
    --pattern-fill-right: #cbd5e1;

    --primary: #16a34a;
    /* green-600 */
    --primary-hover: #15803d;
    /* green-700 */
    --primary-light: #4ade80;

    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --input-text: #0f172a;

    --surface: #ffffff;
    --surface-hover: #f1f5f9;

    /* Glow Card Globals */
    --base: 120;
    --spread: 200;
    --radius: 16;
    --border: 2;
    --backdrop: rgba(255, 255, 255, 0.8);
    --backup-border: var(--border-color);
    --size: 250;
    --outer: 1;
    --border-size: calc(var(--border) * 1px);
    --spotlight-size: calc(var(--size) * 1px);
    --hue: calc(var(--base) + (var(--xp, 0) * var(--spread)));
}

html.dark {
    --bg-color: #020617;
    /* slate-950 */
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    /* slate-300 */
    --text-faint: #64748b;
    /* slate-500 */
    --border-color: rgba(51, 65, 85, 0.5);
    /* slate-700/50 */
    --card-bg: rgba(15, 23, 42, 0.5);
    /* slate-900/50 */
    --card-border: rgba(51, 65, 85, 0.5);

    --pattern-fill-left: #1e293b;
    --pattern-fill-right: #334155;

    --primary: #22c55e;
    /* green-500 */
    --primary-hover: #16a34a;
    /* green-600 */
    --primary-light: #4ade80;

    --input-bg: rgba(30, 41, 59, 0.5);
    /* slate-800/50 */
    --input-border: #334155;
    /* slate-700 */
    --input-text: #ffffff;

    --surface: rgba(30, 41, 59, 0.5);
    --surface-hover: #1e293b;

    --backdrop: rgba(15, 23, 42, 0.5);
    --backup-border: rgba(51, 65, 85, 0.5);
}

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.5s, color 0.5s;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-visual-side {
    display: none;
    position: relative;
    overflow: hidden;
    width: 50%;
}

@media (min-width: 1024px) {
    .auth-visual-side {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.auth-form-side {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

@media (min-width: 1024px) {
    .auth-form-side {
        width: 50%;
        padding: 3rem;
    }
}

/* ─── Background Patterns ─── */
.bg-pattern {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

.pattern-grid {
    background-image: linear-gradient(to right, var(--pattern-fill-left) 1px, transparent 1px),
        linear-gradient(to bottom, var(--pattern-fill-left) 1px, transparent 1px);
    background-size: 40px 40px;
}

.pattern-dots {
    background-image: radial-gradient(var(--pattern-fill-right) 1px, transparent 1px);
    background-size: 30px 30px;
}

.fade-edges {
    mask-image: radial-gradient(ellipse at center, black, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 80%);
}

.fade-center {
    mask-image: radial-gradient(ellipse at center, transparent 20%, black 100%);
    -webkit-mask-image: radial-gradient(ellipse at center, transparent 20%, black 100%);
}

/* ─── Theme Toggle ─── */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    padding: 0.75rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    z-index: 20;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: var(--surface-hover);
}

.theme-toggle i {
    font-size: 1.25rem;
}

/* ─── Left Visual Content ─── */
.visual-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 32rem;
    padding: 3rem;
    text-align: center;
}

.visual-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.visual-header i {
    font-size: 3rem;
    color: var(--primary);
}

.visual-header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.visual-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.visual-desc {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.visual-showcase {
    position: relative;
    width: 100%;
    height: 16rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.showcase-bg {
    position: absolute;
    inset: 0;
    border-radius: 1.5rem;
    background: linear-gradient(to bottom right, rgba(34, 197, 94, 0.2), rgba(59, 130, 246, 0.2));
}

.showcase-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 2;
}

.showcase-icon {
    width: 8rem; 
    height: 8rem;
    border-radius: 50%; /* جعل الحواف دائرية بنسبة 50% */
    overflow: hidden; /* لمنع أي جزء من الصورة من الخروج خارج الدائرة */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.showcase-icon i {
    font-size: 4rem;
    color: var(--primary);
}

.showcase-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.showcase-feature {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-main);
    font-weight: 500;
}

.visual-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.stat-item h3 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-item p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ─── Right Form Content ─── */
.form-container {
    width: 100%;
    max-width: 28rem;
    position: relative;
    z-index: 10;
}

.mobile-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1024px) {
    .mobile-logo {
        display: none;
    }
}

.mobile-logo i {
    font-size: 2rem;
    color: var(--primary);
}

.mobile-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ─── GlowCard Styles ─── */
[data-glow] {
    --x: 50;
    --y: 50;
    --xp: 0.5;
    --yp: 0.5;
}

.glow-card {
    position: relative;
    border-radius: calc(var(--radius) * 1px);
    background-color: var(--backdrop);
    border: var(--border-size) solid var(--backup-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2.5rem;
    box-shadow: 0 1rem 2rem -1rem rgba(0, 0, 0, 0.5);
    background-image: radial-gradient(var(--spotlight-size) var(--spotlight-size) at calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px),
            hsl(var(--hue) 100% 70% / 0.1), transparent);
    background-size: calc(100% + calc(var(--border-size) * 2)) calc(100% + calc(var(--border-size) * 2));
    background-position: 50% 50%;
    background-attachment: fixed;
    touch-action: none;
}

.glow-card::before,
.glow-card::after {
    pointer-events: none;
    content: "";
    position: absolute;
    inset: calc(var(--border-size) * -1);
    border: var(--border-size) solid transparent;
    border-radius: calc(var(--radius) * 1px);
    background-attachment: fixed;
    background-size: calc(100% + calc(var(--border-size) * 2)) calc(100% + calc(var(--border-size) * 2));
    background-repeat: no-repeat;
    background-position: 50% 50%;
    mask: linear-gradient(transparent, transparent), linear-gradient(white, white);
    mask-clip: padding-box, border-box;
    mask-composite: intersect;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
}

.glow-card::before {
    background-image: radial-gradient(calc(var(--spotlight-size) * 0.75) calc(var(--spotlight-size) * 0.75) at calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px),
            hsl(var(--hue) 100% 50% / 1), transparent 100%);
    filter: brightness(2);
}

.glow-card::after {
    background-image: radial-gradient(calc(var(--spotlight-size) * 0.5) calc(var(--spotlight-size) * 0.5) at calc(var(--x, 0) * 1px) calc(var(--y, 0) * 1px),
            hsl(0 100% 100% / 1), transparent 100%);
}

.glow-inner {
    position: absolute;
    inset: 0;
    will-change: filter;
    opacity: var(--outer);
    border-radius: calc(var(--radius) * 1px);
    border-width: calc(var(--border-size) * 20);
    filter: blur(calc(var(--border-size) * 10));
    background: none;
    pointer-events: none;
    border: none;
}

.glow-inner::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-width: 10px;
}

.glow-content {
    position: relative;
    z-index: 2;
}


/* ─── Form Controls (Replacing Old MVC classes to match Tailwind) ─── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    font-size: 1.1rem;
    color: var(--text-faint);
    pointer-events: none;
    z-index: 1;
}

.form-control {
    width: 100%;
    height: 2.5rem;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.375rem;
    color: var(--input-text);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.form-control::placeholder {
    color: var(--text-faint);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    z-index: 2;
}

/* ─── Buttons ─── */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.5rem;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    height: 2.5rem;
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.btn-social:hover {
    background: var(--surface-hover);
}

/* ─── Links & Utils ─── */
.form-utils {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-main);
    cursor: pointer;
}

.check-row input[type="checkbox"] {
    accent-color: var(--primary);
    width: 1rem;
    height: 1rem;
}

.link-primary,
.link-accent {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.link-primary:hover,
.link-accent:hover {
    text-decoration: underline;
}

.form-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.social-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ─── Validation ─── */
.field-validation-error,
.text-danger {
    font-size: 0.75rem;
    color: #ef4444;
    /* red-500 */
    margin-top: 0.25rem;
    display: block;
}

.validation-summary-errors {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #ef4444;
}

/* ─── OTP / Alert Boxes ─── */
.otp-boxes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.otp-box {
    width: 3rem;
    height: 3.5rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.375rem;
    color: var(--input-text);
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    transition: all 0.2s;
}

.otp-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.alert {
    padding: 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #16a34a;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-icon-wrap {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.status-icon-wrap.teal {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.status-icon-wrap.red {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.tanta-logo {
    width: 100%;
    height: 100%; /* اجعل الطول والعرض 100% ليملا الدائرة */
    object-fit: cover; /* لضمان ملء الدائرة دون تشويه الصورة */
    border-radius: 50%; /* اجعل صورة اللوجو نفسها دائرية أيضاً */
}
/* ─── Responsive ─── */
@media (max-width: 640px) {
    .field-row {
        grid-template-columns: 1fr;
    }

    .glow-card {
        padding: 1.5rem;
    }

    .otp-boxes {
        gap: 0.25rem;
    }

    .otp-box {
        width: 2.5rem;
        height: 3rem;
        font-size: 1.1rem;
    }
}