/* ==========================================================================
   Sign in / sign up / password pages (layouts/auth.blade.php)
   Same look as the landing page (index4): indigo -> violet gradient, Cairo / Inter.
   The font family comes from --font, set in the layout.
   ========================================================================== */

:root {
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --accent: #10b981;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e5e7eb;
    --soft: #f5f7ff;
    --red: #dc2626;
    --red-soft: #fef2f2;
    --green-soft: #ecfdf5;
    --gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #a855f7 100%);
    --gradient-dark: linear-gradient(160deg, #0b0a1f 0%, #1e1b4b 55%, #312e81 100%);
    --shadow-glow: 0 14px 36px rgba(79, 70, 229, .30);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body { font-family: var(--font); color: var(--text); line-height: 1.6; background: #fff; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
:focus-visible { outline: 3px solid rgba(79, 70, 229, .45); outline-offset: 2px; border-radius: 8px; }

.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); min-height: 100vh; }

/* ---- brand side ---- */
.auth-brand { position: relative; display: flex; flex-direction: column; padding: 32px 56px 48px; color: #fff; background: var(--gradient-dark); overflow: hidden; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background:
        radial-gradient(520px 320px at 85% 10%, rgba(168, 85, 247, .32), transparent 70%),
        radial-gradient(420px 300px at 0% 100%, rgba(16, 185, 129, .18), transparent 70%); pointer-events: none; }
.auth-brand > * { position: relative; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-logo { display: inline-flex; align-items: center; gap: .6rem; color: #fff; font-size: 1.35rem; font-weight: 900; text-decoration: none; }
.auth-logo-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--gradient); color: #fff; font-size: 1rem; box-shadow: 0 8px 22px rgba(124, 58, 237, .45); }
.auth-lang { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.auth-lang a { padding: .2rem .75rem; border-radius: 999px; color: rgba(255, 255, 255, .75); font-size: .8rem; font-weight: 700; text-decoration: none; }
.auth-lang a.active { background: #fff; color: var(--ink); }

.auth-brand-body { margin: auto 0; padding: 40px 0; max-width: 520px; }
.auth-brand h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 900; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 1rem; }
.auth-brand h2 span { background: linear-gradient(135deg, #c4b5fd, #a5f3fc); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-brand p { color: rgba(255, 255, 255, .72); font-size: 1.05rem; max-width: 460px; }
.auth-points { list-style: none; display: grid; gap: .7rem; margin-top: 1.8rem; }
.auth-points li { display: flex; align-items: center; gap: .7rem; color: rgba(255, 255, 255, .88); font-weight: 600; }
.auth-points i { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(16, 185, 129, .18); color: #6ee7b7; font-size: .85rem; }
.auth-stats { display: flex; gap: 2.4rem; margin-top: 2rem; }
.auth-stats b { display: block; font-size: 1.7rem; font-weight: 900; color: #6ee7b7; direction: ltr; unicode-bidi: isolate; text-align: start; }
.auth-stats span { color: rgba(255, 255, 255, .65); font-size: .88rem; }
.auth-art { width: 100%; max-width: 420px; height: auto; margin-top: 2rem; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .35)); animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.auth-foot { color: rgba(255, 255, 255, .45); font-size: .82rem; }
.auth-foot a { color: rgba(255, 255, 255, .7); text-decoration: none; }

/* ---- form side ---- */
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; background: #fff; }
.auth-card { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-card.is-wide { max-width: 460px; }
.auth-back { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.6rem; color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; }
.auth-back:hover { color: var(--primary); }
.auth-head { margin-bottom: 1.6rem; }
.auth-icon { width: 56px; height: 56px; margin-bottom: 1.1rem; border-radius: 18px; display: grid; place-items: center; background: var(--soft); color: var(--primary); font-size: 1.4rem; }
.auth-badge { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .8rem; padding: .25rem .8rem; border-radius: 999px; background: var(--green-soft); color: #047857; font-size: .82rem; font-weight: 800; }
.auth-head h1 { color: var(--ink); font-size: 1.85rem; font-weight: 900; line-height: 1.25; letter-spacing: -.01em; }
.auth-head p { margin-top: .35rem; color: var(--muted); }

.alert { display: flex; gap: .65rem; padding: .85rem 1rem; margin-bottom: 1.2rem; border-radius: 14px; font-size: .92rem; line-height: 1.6; }
.alert i { margin-top: .2rem; }
.alert-error { background: var(--red-soft); color: #991b1b; border: 1px solid #fecaca; }
.alert[hidden] { display: none; }
.alert-success { background: var(--green-soft); color: #065f46; border: 1px solid #a7f3d0; }

.social { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .7rem; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: .6rem; min-height: 48px; padding: .6rem 1rem; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-weight: 700; font-size: .95rem; text-decoration: none; transition: border-color .2s, background .2s, transform .2s; }
.social-btn:hover { border-color: #c7d2fe; background: var(--soft); transform: translateY(-1px); }
.social-btn .fa-google { color: #ea4335; font-size: 1.1rem; }
.social-btn .fa-x-twitter { color: #000; font-size: 1.05rem; }
.social-btn .fa-apple { color: #000; font-size: 1.2rem; }
.social-btn.is-loading { opacity: .6; pointer-events: none; }
.or { display: flex; align-items: center; gap: .9rem; margin: 1.4rem 0; color: var(--faint); font-size: .85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.field { margin-bottom: 1.05rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .9rem; }
.field label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; color: var(--ink); font-size: .9rem; font-weight: 700; }
.field label a { font-size: .85rem; font-weight: 700; text-decoration: none; }
.field label a:hover { text-decoration: underline; }
.control { position: relative; }
.control > i { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); color: var(--faint); font-size: .95rem; pointer-events: none; transition: color .2s; }
.control:focus-within > i { color: var(--primary); }
.input { width: 100%; height: 50px; padding: 0 14px; padding-inline-start: 42px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); font-family: inherit; font-size: 1rem; transition: border-color .2s, box-shadow .2s; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #cbd5e1; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.input.has-eye { padding-inline-end: 46px; }
.input.is-invalid { border-color: #f87171; box-shadow: 0 0 0 4px rgba(220, 38, 38, .08); }
/* emails / phones / passwords: the text orders itself by its own content (an email stays LTR)
   while the box keeps the page direction, so the icon and its padding stay on the same side */
.input.is-ltr { unicode-bidi: plaintext; direction: inherit; } /* inherit: Chrome forces type="tel" to ltr */
[dir="rtl"] .input.is-ltr { text-align: right; }
.eye { position: absolute; top: 50%; inset-inline-end: 8px; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--faint); cursor: pointer; }
.eye:hover { background: var(--soft); color: var(--primary); }
.field-error { display: block; margin-top: .35rem; color: var(--red); font-size: .84rem; font-weight: 600; }
.field-error p { margin: 0; }
.field-error:empty { display: none; }
.field-hint { margin-top: .35rem; color: var(--muted); font-size: .82rem; }
.caps { display: none; margin-top: .35rem; color: #b45309; font-size: .82rem; font-weight: 700; }
.caps.show { display: block; }

.strength { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.strength-bar { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bar span { height: 5px; border-radius: 999px; background: var(--line); transition: background .25s; }
.strength[data-score="1"] .strength-bar span:nth-child(-n+1) { background: #ef4444; }
.strength[data-score="2"] .strength-bar span:nth-child(-n+2) { background: #f59e0b; }
.strength[data-score="3"] .strength-bar span:nth-child(-n+3) { background: #22c55e; }
.strength[data-score="4"] .strength-bar span:nth-child(-n+4) { background: #16a34a; }
.strength small { min-width: 64px; color: var(--muted); font-size: .8rem; font-weight: 700; text-align: end; }
.match { margin-top: .35rem; font-size: .82rem; font-weight: 700; }
.match.ok { color: #16a34a; }
.match.bad { color: var(--red); }

.options { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: .2rem 0 1.3rem; }
.check { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

.btn-submit { position: relative; width: 100%; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: .55rem; border: 0; border-radius: 14px; background: var(--gradient); color: #fff; font-family: inherit; font-size: 1.02rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow-glow); transition: transform .2s, box-shadow .2s, opacity .2s; }
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(79, 70, 229, .38); }
.btn-submit:disabled { opacity: .75; cursor: progress; transform: none; }
.btn-submit .spin { display: none; }
.btn-submit.is-loading .spin { display: inline-block; animation: spin 1s linear infinite; }
.btn-submit.is-loading .ico { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; width: 100%; min-height: 50px; border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); font-weight: 800; text-decoration: none; transition: border-color .2s, color .2s; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.terms { margin: .3rem 0 1.1rem; color: var(--muted); font-size: .86rem; line-height: 1.7; }
.terms a { font-weight: 700; text-decoration: none; }
.terms a:hover { text-decoration: underline; }

.switch-link { margin-top: 1.5rem; padding-top: 1.3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; text-align: center; }
.switch-link a { font-weight: 800; text-decoration: none; }
.switch-link a:hover { text-decoration: underline; }

/* math captcha (register) */
.captcha { margin-bottom: 1.1rem; padding: .9rem 1rem; border: 1.5px dashed #c7d2fe; border-radius: 14px; background: #fafaff; }
.captcha-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: .55rem; color: var(--ink); font-size: .88rem; font-weight: 800; }
.captcha-top i { color: var(--primary); }
.captcha-top small { color: var(--muted); font-weight: 600; }
.captcha-row { display: flex; align-items: center; gap: .6rem; }
.captcha-q { flex: 1; min-height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: 1.1rem; font-weight: 800; direction: ltr; unicode-bidi: bidi-override; letter-spacing: .03em; }
.captcha-a { width: 96px; height: 46px; border: 1.5px solid var(--line); border-radius: 12px; text-align: center; font-family: inherit; font-size: 1.05rem; font-weight: 800; direction: ltr; }
.captcha-a:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
.captcha-a.is-invalid { border-color: #f87171; }
.captcha-r { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); cursor: pointer; }
.captcha-r:hover { color: var(--primary); border-color: #c7d2fe; }
.captcha-r:disabled .fa-sync-alt { animation: spin 1s linear infinite; }

/* select2 in the register form (body prefix: select2.min.css loads after this file) */
body .select2-container { width: 100% !important; }
body .select2-container--default .select2-selection--single { height: 50px; border: 1.5px solid var(--line); border-radius: 14px; }
body .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 47px; padding-inline: 14px 34px; color: var(--ink); }
body .select2-container--default .select2-selection--single .select2-selection__arrow { height: 48px; }
body .select2-container--default.select2-container--focus .select2-selection--single,
body .select2-container--default.select2-container--open .select2-selection--single { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, .12); }
body .select2-dropdown { border-color: var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 18px 40px rgba(15, 23, 42, .12); }
body .select2-search--dropdown .select2-search__field { height: 38px; border-radius: 9px; }

/* success state (forgot password) */
.done { text-align: center; }
.done-icon { width: 76px; height: 76px; margin: 0 auto 1.2rem; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: #059669; font-size: 1.9rem; box-shadow: 0 0 0 10px rgba(16, 185, 129, .08); }
.done h2 { color: var(--ink); font-size: 1.5rem; font-weight: 900; margin-bottom: .5rem; }
.done p { color: var(--muted); margin-bottom: 1.5rem; }
.done .field-hint { margin: -.6rem 0 1.4rem; }

/* ---- responsive ---- */
@media (max-width: 1100px) {
    .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 500px); }
    .auth-brand { padding: 28px 36px 40px; }
    .auth-main { padding: 40px 36px; }
    .auth-art { display: none; }
}
@media (max-width: 860px) {
    .auth { grid-template-columns: 1fr; }
    .auth-brand { padding: 20px 20px 28px; }
    .auth-brand-body { padding: 22px 0 0; }
    .auth-brand h2 { font-size: 1.5rem; margin-bottom: .4rem; }
    .auth-brand p { font-size: .95rem; }
    .auth-points, .auth-stats, .auth-foot { display: none; }
    .auth-main { padding: 28px 20px 40px; justify-content: flex-start; }
}
@media (max-width: 480px) {
    .field-row { grid-template-columns: 1fr; }
    .auth-head h1 { font-size: 1.55rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
