/* =====================================================================
   Maysan E-Invoicing - sign-in pages ("light product preview" split screen)
   Uses the brand tokens defined in landing.css (:root --brand-*).
   LTR/RTL safe: logical properties only.
   ===================================================================== */

body.auth-page { min-height: 100vh; background: var(--brand-white); }

.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 100vh; }
@media (max-width: 991.98px) { .auth-shell { grid-template-columns: 1fr; } }

/* ---------- Form side ---------- */
.auth-form-side { display: flex; flex-direction: column; padding: 2rem clamp(1rem, 5vw, 4.5rem); }
.auth-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.auth-logo img { height: 42px; width: auto; }
.btn-sm.btn-lang { padding: .4rem .95rem; font-size: .9rem; }

.auth-form-wrap { width: 100%; max-width: 420px; margin: auto; padding: 3rem 0; }
.landing .auth-title { font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 800; margin-bottom: .5rem; color: var(--ink); }
.auth-subtitle { color: var(--ink-muted); margin-bottom: 2rem; line-height: 1.7; }

.auth-form { display: grid; gap: 1.2rem; }
.auth-field .form-label { font-weight: 600; margin-bottom: .45rem; }
.auth-input { position: relative; }
.auth-input > i {
    position: absolute; inset-inline-start: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--brand-lavender); font-size: 1.15rem; pointer-events: none;
}
.auth-input .form-control {
    height: 52px; border-radius: 14px; border: 1.5px solid var(--line);
    padding-inline-start: 2.85rem; padding-inline-end: 1rem; font-size: 1rem; background: var(--brand-white);
}
.auth-input .form-control::placeholder { color: #A9A3B8; }
.auth-input .form-control:focus { border-color: var(--brand-bright); box-shadow: 0 0 0 4px rgba(135, 63, 224, .12); }
.auth-input .form-control:focus ~ i, .auth-input:focus-within > i { color: var(--brand-bright); }
.auth-input .form-control.input-validation-error { border-color: #DC3545; }
.auth-input:has(.auth-eye) .form-control { padding-inline-end: 3rem; }

.auth-eye {
    position: absolute; inset-inline-end: .5rem; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent;
    color: var(--ink-muted); font-size: 1.15rem; display: grid; place-items: center;
}
.auth-eye:hover { background: var(--brand-tint); color: var(--brand-primary); }
.auth-eye:focus-visible { outline: 3px solid var(--brand-lavender); outline-offset: 1px; }

.auth-error { display: block; color: #DC3545; font-size: .85rem; margin-top: .35rem; }
.auth-alert { border-radius: 12px; background: #FDECEE; color: #B42318; padding: .8rem 1rem; font-size: .92rem; }
.auth-alert.validation-summary-valid { display: none; }
.auth-alert ul { margin: 0; padding-inline-start: 1.1rem; }
.auth-notice { border-radius: 12px; background: #E8F7EE; color: #12733A; padding: .8rem 1rem; font-size: .92rem; display: flex; gap: .5rem; align-items: center; }

.landing a.auth-link { color: var(--brand-primary); font-weight: 600; text-decoration: none; }
.landing a.auth-link:hover { color: var(--brand-deep); text-decoration: underline; }
.auth-switch { text-align: center; color: var(--ink-muted); margin: 1.75rem 0 0; }

.auth-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; font-size: .85rem; color: var(--ink-muted); }
.landing a.auth-link-muted { color: var(--ink-muted); text-decoration: none; }
.landing a.auth-link-muted:hover { color: var(--brand-primary); }

/* ---------- Product preview side ---------- */
.auth-preview {
    position: relative; overflow: hidden;
    background: linear-gradient(160deg, var(--brand-tint) 0%, var(--brand-tint-2) 100%);
    border-start-start-radius: 32px; border-end-start-radius: 32px;
    display: flex; align-items: center; justify-content: center; padding: 3rem;
}
/* Faint eight-point star pattern (same motif as the landing hero), in deep violet */
.auth-preview::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .07;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23351078' stroke-width='1.2'%3E%3Cg id='s'%3E%3Crect x='30' y='30' width='36' height='36'/%3E%3Crect x='30' y='30' width='36' height='36' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='7'/%3E%3C/g%3E%3Cuse href='%23s' x='-48' y='-48'/%3E%3Cuse href='%23s' x='48' y='-48'/%3E%3Cuse href='%23s' x='-48' y='48'/%3E%3Cuse href='%23s' x='48' y='48'/%3E%3Cpath d='M48 0v22M48 74v22M0 48h22M74 48h22'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 96px 96px;
}
.auth-preview::after {
    content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
    inset-inline-end: -160px; top: -160px; pointer-events: none;
    background: radial-gradient(circle, rgba(185, 154, 239, .55), transparent 70%);
}
@media (max-width: 991.98px) { .auth-preview { display: none; } }

.auth-preview-inner { position: relative; z-index: 1; width: 100%; max-width: 520px; }

.preview-stack { position: relative; height: 380px; margin-bottom: 2.5rem; }
.pv-card {
    position: absolute; background: var(--brand-white); border-radius: 18px; padding: 1.15rem 1.25rem;
    box-shadow: 0 18px 45px rgba(53, 16, 120, .14); border: 1px solid rgba(185, 154, 239, .35);
}
.pv-label { display: block; color: var(--ink-muted); font-size: .85rem; }
.pv-note { display: block; color: var(--ink-muted); font-size: .78rem; margin-top: .55rem; }
.pv-note i { color: var(--brand-bright); }
.pv-value { font-size: 2rem; font-weight: 800; color: var(--brand-deep); line-height: 1.15; margin-top: .25rem; }
.pv-value i { font-size: 1.4rem; color: var(--brand-bright); }

.pv-head { display: flex; align-items: center; gap: .6rem; }
.pv-icon {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; color: var(--brand-white);
    background: linear-gradient(135deg, var(--brand-bright), var(--brand-primary));
}
.pv-progress { height: 8px; border-radius: 99px; background: var(--brand-tint-2); margin-top: .8rem; overflow: hidden; }
.pv-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-bright), var(--brand-primary)); }
.is-rtl .pv-progress span { margin-inline-start: auto; background: linear-gradient(270deg, var(--brand-bright), var(--brand-primary)); }

.pv-wallet { inset-inline-start: 0; top: 10px; width: 270px; }
.pv-package { inset-inline-end: 0; top: 0; width: 200px; }
.pv-package strong { font-size: 1.15rem; color: var(--ink); }
.pv-chip-gold {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--brand-white);
    background: linear-gradient(135deg, #F2C94C, #C08A12);
}
.pv-invoices { inset-inline-end: 20px; top: 150px; width: 290px; }
.pv-trend { font-size: .8rem; font-weight: 700; color: #1BA34A; background: #E8F7EE; border-radius: 99px; padding: .2rem .55rem; white-space: nowrap; }
.pv-bars { display: flex; align-items: flex-end; gap: 6px; height: 56px; margin-top: .9rem; }
.pv-bars span { flex: 1; border-radius: 6px 6px 3px 3px; background: var(--brand-tint-2); }
.pv-bars span:last-child { background: linear-gradient(180deg, var(--brand-bright), var(--brand-primary)); }

.pv-toast { inset-inline-start: 20px; bottom: 0; display: flex; align-items: center; gap: .75rem; max-width: 330px; padding: .85rem 1.1rem; }
.pv-toast strong { display: block; font-size: .95rem; color: var(--ink); }
.pv-toast small { display: block; color: var(--ink-muted); font-size: .78rem; line-height: 1.4; }
.pv-ok { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; background: #1BA34A; flex-shrink: 0; }

/* gentle float (disabled for reduced motion) */
.pv-wallet  { animation: pv-float 7s ease-in-out infinite; }
.pv-invoices { animation: pv-float 8s ease-in-out -2s infinite; }
.pv-toast   { animation: pv-float 9s ease-in-out -4s infinite; }
@keyframes pv-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .pv-card { animation: none !important; } }

.preview-copy { text-align: center; }
.landing .preview-copy h2 { font-size: 1.6rem; font-weight: 800; color: var(--brand-deep); margin-bottom: .6rem; }
.preview-copy p { color: var(--ink-muted); line-height: 1.75; max-width: 440px; margin: 0 auto; }

@media (min-width: 992px) and (max-width: 1199.98px) {
    .auth-preview { padding: 2rem; }
    .pv-wallet { width: 240px; }
    .pv-invoices { width: 250px; }
}
