:root {
    --brand: #6c1010;
    --brand-soft: #b63c3c;

    /* Light theme */
    --bg-main: #f6f7fb;
    --card-light: #ffffff;
    --text-main: #0f172a;
    --text-muted: #6b7280;

    --radius-lg: 24px;
    --radius-pill: 999px;

    --shadow-strong: 0 18px 50px rgba(2, 6, 23, 0.12);
    --transition-fast: 0.2s ease-out;

    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Reset بسيط */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #ffffff 0, #f3f4f6 55%, #eef2ff 100%);
    color: var(--text-main);
    min-height: 100vh;
    direction: rtl;
}

/* ===== خلفية عامة ===== */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 10% 0%, rgba(108, 16, 16, 0.18), transparent 55%),
        radial-gradient(circle at 90% 100%, rgba(182, 60, 60, 0.16), transparent 55%),
        linear-gradient(180deg, #ffffff 0%, #f6f7fb 100%);
    opacity: 1;
}

/* ===== صفحة عامة ===== */
.auth-wrapper,
.register-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 14px;
}

/* ===================== */
/* ===== Login Card ===== */
/* ===================== */

.auth-circle-card {
    position: relative;
    width: min(520px, 100%);
    aspect-ratio: 1 / 1.05;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
}

/* الحلقة الخارجية */
.auth-circle-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        conic-gradient(from 0deg,
            rgba(108, 16, 16, 0.08) 0deg,
            rgba(108, 16, 16, 0.75) 20deg,
            transparent 40deg);
    background-size: 360deg;
    animation: orbitSpin 18s linear infinite;
    -webkit-mask: radial-gradient(farthest-side, transparent 72%, #000 73%);
    mask: radial-gradient(farthest-side, transparent 72%, #000 73%);
    opacity: 0.85;
}

@keyframes orbitSpin {
    to { transform: rotate(360deg); }
}

/* الكارت الداخلي */
.auth-circle-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at top, #ffffff 0, #f8fafc 70%);
    box-shadow: var(--shadow-strong);
    padding: 26px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

/* اللوجو */
.auth-logo-ring {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffffff, #ffe9e9 45%, var(--brand) 85%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.14);
    margin-bottom: 14px;
    animation: logoFloat 4.5s ease-in-out infinite alternate;
}

.auth-logo-ring img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    border-radius: 18px;
}

@keyframes logoFloat {
    from { transform: translateY(0) scale(1); }
    to   { transform: translateY(-5px) scale(1.03); }
}

/* العنوان */
.auth-heading { margin-bottom: 16px; }

.auth-heading h1 {
    font-size: 22px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.auth-heading p {
    font-size: 12px;
    color: var(--text-muted);
}

/* الفورم */
.auth-form {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.form-group { text-align: right; }

.form-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

.input-wrapper { position: relative; }

.input-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform 0.1s ease-out;
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
}

.input-control::placeholder {
    color: rgba(15, 23, 42, 0.38);
}

.input-control:focus {
    border-color: var(--brand-soft);
    box-shadow: 0 0 0 3px rgba(182, 60, 60, 0.18);
    transform: translateY(-1px);
}

/* أيقونة الباسورد */
.password-toggle {
    position: absolute;
    inset-block: 0;
    left: 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-muted);
}

/* صف صغير */
.login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.login-row a {
    color: var(--brand);
    text-decoration: none;
}

.login-row a:hover { text-decoration: underline; }

/* زر */
.btn-primary {
    border: none;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--brand), var(--brand-soft));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    cursor: pointer;
    margin-top: 6px;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 14px 34px rgba(108, 16, 16, 0.24);
    transition: transform 0.1s ease-out, box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 18px 44px rgba(182, 60, 60, 0.28);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 8px 22px rgba(2, 6, 23, 0.18);
}

.login-footer-text {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

/* رسائل */
.alert {
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 12px;
    margin-bottom: 8px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #991b1b;
}

.alert-success {
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #166534;
}

/* ========================= */
/* ===== Register Card ===== */
/* ========================= */

.register-card {
    width: min(1120px, 100%);
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 23, 42, 0.10);
    box-shadow: var(--shadow-strong);
    padding: 24px 26px 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.register-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 4px;
}

.register-header-main h2 {
    font-size: 20px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.register-header-main p {
    font-size: 12px;
    color: var(--text-muted);
}

.register-logo-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.register-logo-chip .auth-logo-ring {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
}

.register-logo-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* شبكة الحقول */
.register-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.register-grid .form-group { font-size: 13px; }

/* Select نفس شكل الـ input */
.select-control {
    @supports not (appearance: none) { /* fallback */ }
}

/* استخدام نفس class */
select.input-control { padding-right: 10px; }

/* صف تحت */
.register-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.register-footer-row a {
    color: var(--brand);
    text-decoration: none;
}

/* ======================= */
/* ===== Responsiveness === */
/* ======================= */

@media (max-width: 720px) {
    .auth-circle-card {
        width: min(420px, 100%);
        aspect-ratio: 1 / 1.15;
    }

    .auth-circle-inner { padding: 22px 18px; }

    .auth-heading h1 { font-size: 19px; }

    .auth-form { max-width: 100%; }

    .register-card { padding: 20px 16px 18px; }

    .register-header {
        flex-direction: column-reverse;
        align-items: flex-start;
    }

    .register-grid { grid-template-columns: 1fr; }

    .register-footer-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-circle-card { width: 100%; }

    .auth-circle-inner { border-radius: 32px; }
}
