@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&family=Noto+Kufi+Arabic:wght@400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom Global Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary, #0a92d7);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-end, #00f2fe);
}
html {
    scrollbar-width: thin;
    scrollbar-color: var(--primary, #0a92d7) transparent;
}

/* ===== TOKENS ===== */
:root {
    --surface:              #f5f7ff;
    --surface-low:          #edf0f9;
    --surface-container:    #e4e8f7;
    --surface-high:         #d9ddf0;
    --surface-highest:      #cdd2e8;
    --surface-bright:       #ffffff;
    --on-surface:           #1a2035;
    --on-surface-variant:   #4a5472;
    --primary:              #006591;
    --primary-light:        #89ceff;
    --on-primary:           #ffffff;
    --outline:              #88919d;
    --outline-variant:      rgba(0,0,0,0.08);
    --card-bg:              rgba(255,255,255,0.92);
    --header-bg:            rgba(245,247,255,0.80);
    --header-brand:         #006591;
    --header-shadow:        0 4px 20px rgba(0,0,0,0.08);
    --gradient-start:       #1D60AC;
    --gradient-end:         #0A92D7;
    --shadow:               0 2px 10px rgba(0,0,0,0.06);
    --border-color:         rgba(0,0,0,0.09);
    --input-bg:             #ffffff;
    --input-border:         rgba(0,0,0,0.12);
    --input-focus:          rgba(10, 146, 215, 0.15);
    --error-bg:             rgba(239,68,68,0.08);
    --error-border:         rgba(239,68,68,0.2);
    --error-text:           #dc2626;
    --success-bg:           rgba(16,185,129,0.1);
    --success-border:       rgba(16,185,129,0.3);
    --success-text:         #059669;
    --bg-secondary:         #edf0f9;
    --text-primary:         #1a2035;
    --text-secondary:       #4a5472;
    --panel-inactive-bg:    rgba(0,0,0,0.03);
    --panel-inactive-overlay: rgba(245,247,255,0.6);
}

body.dark-mode {
    --surface:              #0c1324;
    --surface-low:          #151b2d;
    --surface-container:    #191f31;
    --surface-high:         #23293c;
    --surface-highest:      #2e3447;
    --surface-bright:       #33394c;
    --on-surface:           #dce1fb;
    --on-surface-variant:   #bec7d4;
    --primary:              #89ceff;
    --primary-light:        #89ceff;
    --on-primary:           #00344d;
    --outline:              #88919d;
    --outline-variant:      rgba(255,255,255,0.07);
    --error-text:           #ff5252;
    --error-bg:             rgba(255,180,171,0.08);
    --error-border:         rgba(255,180,171,0.15);
    --success-bg:           rgba(16,185,129,0.12);
    --success-border:       rgba(16,185,129,0.3);
    --success-text:         #34d399;
    --card-bg:              rgba(35,41,60,0.75);
    --header-bg:            rgba(12,19,36,0.80);
    --header-brand:         #ffffff;
    --header-shadow:        0 4px 20px rgba(0,0,0,0.4);
    --gradient-start:       #1D60AC;
    --gradient-end:         #0A92D7;
    --shadow:               0 2px 10px rgba(0,0,0,0.35);
    --border-color:         rgba(255,255,255,0.07);
    --input-bg:             rgba(21, 27, 45, 0.7);
    --input-border:         rgba(137, 206, 255, 0.2);
    --input-focus:          rgba(137, 206, 255, 0.2);
    --bg-secondary:         #151b2d;
    --text-primary:         #dce1fb;
    --text-secondary:       #bec7d4;
    --panel-inactive-bg:    rgba(0,0,0,0.15);
    --panel-inactive-overlay: rgba(12,19,36,0.65);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
    background: var(--surface);
    color: var(--on-surface);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Grid background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, var(--border-color) 0px, transparent 1px, transparent 40px, var(--border-color) 41px),
        repeating-linear-gradient(90deg, var(--border-color) 0px, transparent 1px, transparent 40px, var(--border-color) 41px);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* Dark mode radial glow */
body.dark-mode::after {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(29,96,172,0.12), transparent);
    pointer-events: none;
    z-index: 0;
}

/* ===== NAVBAR (matches main.php) ===== */
.pr-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--outline-variant);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1001;
    box-shadow: var(--header-shadow);
    transition: background 0.3s ease;
}

.pr-nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.pr-nav-left img {
    height: 36px;
    width: auto;
}

body.dark-mode .pr-nav-left img {
    content: url('../images/logo white outline.png');
}

body:not(.dark-mode) .pr-nav-left img {
    content: url('../images/logo.png');
}

.pr-nav-brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--header-brand);
    text-transform: uppercase;
    white-space: nowrap;
}

body.dark-mode .pr-nav-brand {
    color: #ffffff;
}

.pr-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pr-theme-btn {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    border: none;
    background: var(--outline-variant);
    color: var(--on-surface-variant);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.pr-theme-btn:hover {
    background: var(--surface-high);
    color: var(--primary);
}

.pr-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1rem;
    height: 36px;
    background: var(--outline-variant);
    border: none;
    border-radius: 0.5rem;
    color: var(--on-surface);
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pr-back-btn:hover {
    background: var(--surface-high);
    color: var(--primary);
}

.pr-back-btn i {
    font-size: 0.8rem;
}

/* ===== MAIN CONTAINER ===== */
.pr-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 88px 2rem 2rem;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.pr-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 960px;
    width: 100%;
    animation: prFadeIn 0.5s ease;
}

@keyframes prFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== STEP PANELS ===== */
.pr-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--outline-variant);
    border-radius: 1.25rem;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

body.dark-mode .pr-panel {
    background: rgba(21, 27, 45, 0.85);
    border-color: rgba(137, 206, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Inactive panel dimming */
.pr-panel.inactive {
    opacity: 0.4;
    pointer-events: none;
    user-select: none;
    filter: grayscale(0.3);
}

.pr-panel.inactive .pr-panel-overlay {
    display: block;
}

.pr-panel-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--panel-inactive-overlay);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 50;
    border-radius: 1.25rem;
}

/* Completed panel */
.pr-panel.completed {
    opacity: 0.5;
    pointer-events: none;
}

.pr-panel.completed .pr-panel-overlay {
    display: block;
}

/* Step header */
.pr-step-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.pr-step-number {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(10, 146, 215, 0.25);
}

.pr-panel.inactive .pr-step-number,
.pr-panel.completed .pr-step-number {
    background: var(--outline-variant);
    color: var(--on-surface-variant);
    box-shadow: none;
}

body.dark-mode .pr-panel.inactive .pr-step-number,
body.dark-mode .pr-panel.completed .pr-step-number {
    background: rgba(255,255,255,0.06);
    color: var(--on-surface-variant);
}

.pr-step-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--on-surface-variant);
}

/* Panel title & subtitle */
.pr-panel-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--on-surface);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

body.dark-mode .pr-panel-title { color: #fff; }

.pr-panel-subtitle {
    font-size: 0.95rem;
    color: var(--on-surface-variant);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* ===== FORM ELEMENTS ===== */
.pr-form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.pr-form-label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--on-surface);
    letter-spacing: -0.01em;
}

.pr-form-label .required {
    color: var(--error-text);
    margin-left: 3px;
}

.pr-input-wrapper {
    position: relative;
}

.pr-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--on-surface-variant);
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.pr-input-wrapper:focus-within i {
    color: var(--primary);
}

body.dark-mode .pr-input-wrapper i {
    color: rgba(137, 206, 255, 0.5);
}

body.dark-mode .pr-input-wrapper:focus-within i {
    color: var(--primary);
}

.pr-input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.8rem;
    border: 1.5px solid var(--input-border);
    border-radius: 0.75rem;
    background: var(--input-bg);
    color: var(--on-surface);
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s ease;
    outline: none;
}

.pr-input:hover {
    border-color: var(--primary);
}

.pr-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus);
}

body.dark-mode .pr-input {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: #fff;
}

body.dark-mode .pr-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--input-focus), 0 0 20px rgba(137,206,255,0.08);
}

.pr-input::placeholder {
    color: var(--on-surface-variant);
    opacity: 0.6;
    font-weight: 400;
}

/* ===== SUBMIT BUTTON ===== */
.pr-submit-btn {
    width: 100%;
    padding: 0.55rem 1.35rem;
    background: var(--primary);
    color: var(--on-primary);
    border: none;
    border-radius: 9999px;
    font-family: 'Inter', 'Noto Kufi Arabic', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    box-shadow: 0 4px 14px rgba(10,146,215,0.2);
}

.pr-submit-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 8px 22px rgba(10,146,215,0.32);
}

.pr-submit-btn:active {
    transform: scale(0.96);
}

.pr-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: all !important;
}

body.dark-mode .pr-submit-btn {
    color: #00344d;
}

/* ===== OTP INPUTS ===== */
.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin: 1.5rem 0;
}

.otp-input {
    width: 48px !important;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    padding: 0 !important;
    border: 2px solid var(--input-border) !important;
    border-radius: 0.75rem;
    background: var(--input-bg);
    color: var(--on-surface);
    font-family: 'Inter', sans-serif;
    transition: all 0.25s ease;
    outline: none;
}

body.dark-mode .otp-input {
    background: var(--input-bg) !important;
    border-color: var(--input-border) !important;
    color: #fff;
}

.otp-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--input-focus) !important;
}

/* ===== OTP INFO / RESEND ===== */
.otp-info {
    text-align: center;
    color: var(--on-surface-variant);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.otp-email {
    color: var(--primary);
    font-weight: 700;
}

.resend-otp {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--on-surface-variant);
    font-size: 0.88rem;
}



.timer {
    font-weight: 700;
    color: var(--primary);
}

/* ===== PASSWORD STRENGTH ===== */
.password-strength {
    margin-top: 0.5rem;
    display: none;
}

.password-strength.active { display: block; }

.strength-bar {
    height: 4px;
    background: var(--outline-variant);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.3rem;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-fill.weak   { width: 33%; background: var(--error-text); }
.strength-fill.medium { width: 66%; background: #f59e0b; }
.strength-fill.strong { width: 100%; background: var(--success-text); }

.strength-text {
    font-size: 0.8rem;
    color: var(--on-surface-variant);
}

/* ===== MESSAGES ===== */
.error-messages {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.error-messages ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.error-messages li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.error-messages li:last-child { margin-bottom: 0; }

.success-messages {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.88rem;
}

/* ===== FOOTER LINK ===== */
.pr-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--outline-variant);
}

.pr-footer p {
    color: var(--on-surface-variant);
    font-size: 0.88rem;
}

.pr-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.2s ease;
}

.pr-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ===== COMPLETED CHECK ICON ===== */
.pr-completed-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .pr-nav { padding: 0 1rem; }
    .pr-nav-brand { display: none; }

    .pr-container {
        padding: 80px 1rem 1.5rem;
        align-items: flex-start;
    }

    .pr-content {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        max-width: 100%;
    }

    .pr-panel {
        padding: 1.75rem;
        border-radius: 1rem;
    }

    .pr-panel-title {
        font-size: 1.4rem;
    }

    .pr-panel-subtitle {
        font-size: 0.88rem;
    }

    .pr-step-number {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        border-radius: 10px;
    }

    .otp-input {
        width: 42px !important;
        height: 48px;
        font-size: 1.2rem;
    }

    .otp-input-group {
        gap: 0.4rem;
    }
}

@media (max-width: 480px) {
    .pr-nav { padding: 0 0.75rem; }

    .pr-back-btn span { display: none; }
    .pr-back-btn { padding: 0; width: 36px; justify-content: center; }

    .pr-container {
        padding: 76px 0.75rem 1rem;
    }

    .pr-panel {
        padding: 1.5rem;
    }

    .pr-panel-title {
        font-size: 1.25rem;
    }

    .otp-input {
        width: 38px !important;
        height: 44px;
        font-size: 1.1rem;
    }
}

/* ===== RTL SUPPORT ===== */
[dir="rtl"] .pr-input-wrapper i {
    left: auto;
    right: 1rem;
}

[dir="rtl"] .pr-input {
    padding-left: 1rem;
    padding-right: 2.8rem;
}

[dir="rtl"] .pr-form-label .required {
    margin-left: 0;
    margin-right: 3px;
}

[dir="rtl"] .pr-back-btn {
    flex-direction: row-reverse;
}