/* Stampo modern auth (login) — matches panel theme */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Poppins:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --sa-ink: #1a2b3c;
    --sa-muted: #5b6b7c;
    --sa-line: rgba(26, 43, 60, 0.1);
    /* Defaults — overridden by _brand-colors with real primary/secondary */
    --sa-primary: #E63928;
    --sa-secondary: #7A2488;
    --sa-primary-rgb: 230, 57, 40;
    --sa-teal: var(--sa-primary);
    --sa-teal-deep: var(--sa-secondary);
    --sa-sky: var(--sa-primary);
    --sa-surface: rgba(255, 255, 255, 0.92);
    /* English / French (LTR) */
    --sa-font: 'Poppins', system-ui, sans-serif;
    --sa-display: 'Poppins', system-ui, sans-serif;
    --sa-grad: linear-gradient(135deg, #E63928 0%, #b42e58 50%, #7A2488 100%);
    --sa-page: linear-gradient(145deg, rgba(230, 57, 40, 0.12) 0%, #faf7fb 42%, rgba(122, 36, 136, 0.1) 72%, #f7f5fa 100%);
}

/* Arabic — Cairo (Tajawal fallback) */
html[dir="rtl"],
html[lang="ar"],
html[lang="dz"],
[dir="rtl"],
body.lang-ar {
    --sa-font: 'Cairo', 'Tajawal', system-ui, sans-serif;
    --sa-display: 'Cairo', 'Tajawal', system-ui, sans-serif;
}

.stampo-auth {
    min-height: 100vh;
    margin: 0;
    font-family: var(--sa-font) !important;
    color: var(--sa-ink);
    background: var(--sa-page);
    position: relative;
    overflow-x: hidden;
}

.stampo-auth,
.stampo-auth h1,
.stampo-auth h2,
.stampo-auth h3,
.stampo-auth .form-control,
.stampo-auth .stampo-auth__submit,
.stampo-auth label,
.stampo-auth p,
.stampo-auth span,
.stampo-auth a,
.stampo-auth button,
.stampo-auth input {
    font-family: var(--sa-font) !important;
}

.stampo-auth *,
.stampo-auth *::before,
.stampo-auth *::after {
    box-sizing: border-box;
}

.stampo-auth::before,
.stampo-auth::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.stampo-auth::before {
    width: 420px;
    height: 420px;
    top: -120px;
    left: -80px;
    background: radial-gradient(circle, rgba(var(--sa-primary-rgb), 0.22), transparent 70%);
}

.stampo-auth::after {
    width: 380px;
    height: 380px;
    bottom: -100px;
    right: -60px;
    background: radial-gradient(circle, rgba(var(--sa-primary-rgb), 0.18), transparent 70%);
}

.stampo-auth__shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem;
    align-items: stretch;
    gap: 1.25rem;
}

.stampo-auth__brand {
    position: relative;
    border-radius: 28px;
    padding: 2.5rem 2.25rem;
    background: var(--sa-grad);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    box-shadow: 0 24px 50px rgba(var(--sa-primary-rgb), 0.28);
    min-height: 520px;
    animation: saRise 0.6s ease both;
}

.stampo-auth__brand::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    top: -80px;
    right: -60px;
}

.stampo-auth__brand::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    bottom: 40px;
    left: -40px;
}

.stampo-auth__brand-inner {
    position: relative;
    z-index: 1;
}

.stampo-auth__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2.5rem;
    text-decoration: none;
    color: #fff;
}

.stampo-auth__logo img {
    height: 64px;
    width: 64px;
    max-width: 64px;
    object-fit: cover;
    background: #fff;
    border-radius: 18px;
    padding: 0;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
    display: block;
}

.stampo-auth__eyebrow {
    display: inline-block;
    margin: 0 0 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.88;
}

.stampo-auth__brand h1 {
    margin: 0 0 0.85rem;
    font-family: var(--sa-display);
    font-size: clamp(1.85rem, 3vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
}

.stampo-auth__brand p {
    margin: 0;
    max-width: 28rem;
    font-size: 1.05rem;
    line-height: 1.55;
    opacity: 0.92;
}

.stampo-auth__brand-foot {
    position: relative;
    z-index: 1;
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.85;
}

.stampo-auth__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: saRise 0.65s ease 0.08s both;
}

.stampo-auth__card {
    width: 100%;
    max-width: 440px;
    background: var(--sa-surface);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 24px;
    box-shadow: 0 18px 48px rgba(15, 40, 70, 0.1);
    padding: 2rem 1.75rem 1.75rem;
}

.stampo-auth__card-head {
    margin-bottom: 1.5rem;
}

.stampo-auth__card-head h2 {
    margin: 0 0 0.4rem;
    font-family: var(--sa-display);
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--sa-ink);
}

.stampo-auth__card-head p {
    margin: 0;
    color: var(--sa-muted);
    font-size: 0.95rem;
}

.stampo-auth__badge {
    position: absolute;
    top: 1rem;
    inset-inline-end: 1rem;
    z-index: 2;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--sa-line);
    color: var(--sa-primary);
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(15, 40, 70, 0.06);
}

.stampo-auth .form-group {
    margin-bottom: 1.1rem;
}

.stampo-auth .input-label,
.stampo-auth label.input-label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--sa-ink);
}

.stampo-auth .form-control,
.stampo-auth .form-control-lg {
    height: 48px;
    border-radius: 14px !important;
    border: 1px solid rgba(var(--sa-primary-rgb), 0.22) !important;
    background: #fff !important;
    font-size: 0.98rem !important;
    color: var(--sa-ink) !important;
    padding: 0.65rem 1rem !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stampo-auth .form-control:focus {
    border-color: var(--sa-primary) !important;
    box-shadow: 0 0 0 3px rgba(var(--sa-primary-rgb), 0.18) !important;
}

.stampo-auth .input-group-merge .form-control {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

[dir="rtl"] .stampo-auth .input-group-merge .form-control {
    border-radius: 14px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.stampo-auth .input-group-text {
    border-radius: 0 14px 14px 0 !important;
    border: 1px solid rgba(var(--sa-primary-rgb), 0.22) !important;
    border-left: 0 !important;
    background: rgba(var(--sa-primary-rgb), 0.08) !important;
    color: var(--sa-primary);
}

[dir="rtl"] .stampo-auth .input-group-text {
    border-radius: 14px 0 0 14px !important;
    border-left: 1px solid rgba(var(--sa-primary-rgb), 0.22) !important;
    border-right: 0 !important;
}

.stampo-auth .input-label a {
    color: var(--sa-sky);
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
}

.stampo-auth .input-label a:hover {
    text-decoration: underline;
}

.stampo-auth .custom-control-label {
    color: var(--sa-muted) !important;
    font-weight: 500;
}

.stampo-auth .custom-checkbox .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--sa-primary);
    border-color: var(--sa-primary);
}

.stampo-auth__submit {
    display: block;
    width: 100%;
    height: 50px;
    margin-top: 0.35rem;
    border: 0;
    border-radius: 14px;
    background: var(--sa-grad);
    color: #fff;
    font-family: var(--sa-font);
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 28px rgba(var(--sa-primary-rgb), 0.35);
    transition: transform 0.2s ease, filter 0.2s ease;
    cursor: pointer;
}

.stampo-auth__submit:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
    color: #fff;
}

.stampo-auth__footer {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sa-line);
    font-size: 0.88rem;
    color: var(--sa-muted);
}

.stampo-auth__footer .btn {
    border-radius: 10px;
    background: var(--sa-grad);
    border: 0;
    color: #fff;
}

.stampo-auth__captcha {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    align-items: center;
    margin-bottom: 1rem;
}

.stampo-auth__captcha-img {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid var(--sa-line);
}

.stampo-auth__captcha-img img {
    max-height: 44px;
    border-radius: 6px;
}

.stampo-auth__captcha-img .icon {
    color: var(--sa-primary);
    cursor: pointer;
}

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

@media (max-width: 991.98px) {
    .stampo-auth__shell {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1rem;
    }

    .stampo-auth__brand {
        min-height: auto;
        padding: 1.5rem 1.35rem;
        border-radius: 22px;
    }

    .stampo-auth__logo {
        margin-bottom: 1.25rem;
    }

    .stampo-auth__brand h1 {
        font-size: 1.65rem;
    }

    .stampo-auth__brand p {
        font-size: 0.95rem;
    }

    .stampo-auth__brand-foot {
        margin-top: 1.25rem;
    }

    .stampo-auth__card {
        max-width: none;
        padding: 1.5rem 1.25rem;
        border-radius: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .stampo-auth__brand,
    .stampo-auth__panel,
    .stampo-auth__submit {
        animation: none !important;
        transition: none !important;
    }
}
