/* ==========================================================================
   IrFlex — Authentication design system
   Namespaced `ira-` so it cannot collide with Tailwind or the Glover theme.
   Token values intentionally mirror irflex-crm.css so auth and the partner
   portal read as one product.
   ========================================================================== */

:root {
    --ira-bg: #f4f6fb;
    --ira-surface: #ffffff;
    --ira-surface-soft: #f8f9fc;
    --ira-text: #151a2d;
    --ira-muted: #68708a;
    --ira-line: #e6e9f1;
    --ira-primary: #9d1695;
    --ira-primary-2: #6f2bd1;
    --ira-primary-3: #4d1aa8;
    --ira-navy: #12172b;
    --ira-success: #17a673;
    --ira-danger: #dc4c64;
    --ira-on-brand: #ffffff;
    --ira-field-bg: #ffffff;
    --ira-field-line: #dde1ec;
    --ira-shadow: 0 24px 70px rgba(25, 29, 52, .14);
    --ira-radius-sm: 12px;
    --ira-radius: 18px;
    --ira-radius-lg: 26px;
    --ira-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root:not([data-theme="light"]) {
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --ira-bg: #0e1220;
        --ira-surface: #171c2d;
        --ira-surface-soft: #111625;
        --ira-text: #f7f8fc;
        --ira-muted: #a0a8bd;
        --ira-line: #293047;
        --ira-field-bg: #111625;
        --ira-field-line: #2f374f;
        --ira-shadow: 0 26px 80px rgba(0, 0, 0, .45);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --ira-bg: #0e1220;
    --ira-surface: #171c2d;
    --ira-surface-soft: #111625;
    --ira-text: #f7f8fc;
    --ira-muted: #a0a8bd;
    --ira-line: #293047;
    --ira-field-bg: #111625;
    --ira-field-line: #2f374f;
    --ira-shadow: 0 26px 80px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

/* ---------- shell ---------------------------------------------------- */

body.ira-body {
    margin: 0;
    min-height: 100vh;
    background: var(--ira-bg);
    color: var(--ira-text);
    font-family: var(--ira-font);
    -webkit-font-smoothing: antialiased;
}

.ira-shell {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

/* ---------- brand panel ---------------------------------------------- */

.ira-brand {
    position: relative;
    overflow: hidden;
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        radial-gradient(120% 90% at 12% 8%, rgba(157, 22, 149, .55) 0%, transparent 55%),
        radial-gradient(120% 110% at 92% 92%, rgba(79, 26, 168, .65) 0%, transparent 58%),
        linear-gradient(150deg, #2a0f4d 0%, #17093a 48%, #0d0722 100%);
    color: #fff;
}

/* soft mesh so the panel is not a flat gradient */
.ira-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 22% 30%, rgba(255, 255, 255, .10) 0 1px, transparent 1px),
        radial-gradient(circle at 68% 72%, rgba(255, 255, 255, .07) 0 1px, transparent 1px);
    background-size: 46px 46px, 62px 62px;
    opacity: .7;
    pointer-events: none;
}

.ira-brand > * { position: relative; z-index: 1; }

.ira-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -.01em;
}

.ira-brand-mark img { height: 44px; width: auto; display: block; }

.ira-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .18);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.ira-brand-headline {
    margin: 28px 0 14px;
    font-size: clamp(30px, 3.4vw, 46px);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -.025em;
    max-width: 15ch;
}

.ira-brand-sub {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: rgba(255, 255, 255, .78);
    max-width: 44ch;
}

.ira-brand-list {
    list-style: none;
    margin: 34px 0 0;
    padding: 0;
    display: grid;
    gap: 15px;
}

.ira-brand-list li {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, .9);
}

.ira-tick {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
}

.ira-tick svg { width: 13px; height: 13px; }

.ira-brand-foot {
    font-size: 12.5px;
    color: rgba(255, 255, 255, .55);
}

/* ---------- form side ------------------------------------------------ */

.ira-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--ira-bg);
}

.ira-card {
    width: 100%;
    max-width: 430px;
}

.ira-card-head { margin-bottom: 28px; }

.ira-eyebrow {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ira-primary);
    margin: 0 0 10px;
}

.ira-title {
    margin: 0 0 8px;
    font-size: 29px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--ira-text);
}

.ira-subtitle {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--ira-muted);
}

/* fields */

.ira-field { margin-bottom: 17px; }

.ira-label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ira-text);
}

.ira-input,
.ira-select {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    font-size: 14.5px;
    font-family: inherit;
    color: var(--ira-text);
    background: var(--ira-field-bg);
    border: 1.5px solid var(--ira-field-line);
    border-radius: var(--ira-radius-sm);
    transition: border-color .16s ease, box-shadow .16s ease;
    outline: none;
}

.ira-input::placeholder { color: var(--ira-muted); opacity: .72; }

.ira-input:focus,
.ira-select:focus {
    border-color: var(--ira-primary);
    box-shadow: 0 0 0 4px rgba(157, 22, 149, .13);
}

.ira-input.is-invalid { border-color: var(--ira-danger); }

.ira-input-wrap { position: relative; }

.ira-input-wrap .ira-input { padding-right: 46px; }

.ira-reveal {
    position: absolute;
    top: 50%;
    inset-inline-end: 12px;
    transform: translateY(-50%);
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--ira-muted);
    padding: 4px;
    line-height: 0;
    border-radius: 6px;
}

.ira-reveal:hover { color: var(--ira-primary); }
.ira-reveal svg { width: 19px; height: 19px; }

.ira-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ira-danger);
}

.ira-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ira-muted);
}

/* row helpers */

.ira-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.ira-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 4px 0 22px;
    flex-wrap: wrap;
}

.ira-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    color: var(--ira-muted);
    cursor: pointer;
    user-select: none;
}

.ira-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--ira-primary);
    cursor: pointer;
    margin: 0;
}

.ira-link {
    color: var(--ira-primary);
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
}

.ira-link:hover { text-decoration: underline; }

/* buttons */

.ira-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--ira-radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .18s ease, opacity .16s ease;
}

.ira-btn:active { transform: translateY(1px); }

.ira-btn-primary {
    background: linear-gradient(135deg, var(--ira-primary) 0%, var(--ira-primary-2) 100%);
    color: var(--ira-on-brand);
    box-shadow: 0 12px 28px rgba(111, 43, 209, .28);
}

.ira-btn-primary:hover { box-shadow: 0 16px 36px rgba(111, 43, 209, .36); }

.ira-btn-primary[disabled] { opacity: .62; cursor: not-allowed; }

.ira-btn-ghost {
    background: var(--ira-surface);
    color: var(--ira-text);
    border-color: var(--ira-line);
}

.ira-btn-ghost:hover { border-color: var(--ira-primary); color: var(--ira-primary); }

.ira-btn svg { width: 18px; height: 18px; flex: none; }

/* divider */

.ira-or {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 24px 0;
    color: var(--ira-muted);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.ira-or::before,
.ira-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--ira-line);
}

.ira-alt { display: grid; gap: 11px; }

.ira-foot {
    margin-top: 26px;
    text-align: center;
    font-size: 13.5px;
    color: var(--ira-muted);
}

.ira-foot a { color: var(--ira-primary); font-weight: 600; text-decoration: none; }
.ira-foot a:hover { text-decoration: underline; }

/* topbar (language + theme) */

.ira-topbar {
    position: absolute;
    top: 26px;
    inset-inline-end: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 3;
}

.ira-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ira-text);
    background: var(--ira-surface);
    border: 1px solid var(--ira-line);
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
}

.ira-chip:hover { border-color: var(--ira-primary); }
.ira-chip svg { width: 16px; height: 16px; }

/* sponsor callout used by partner signup */

.ira-sponsor {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: var(--ira-radius-sm);
    background: linear-gradient(135deg, rgba(157, 22, 149, .09), rgba(111, 43, 209, .09));
    border: 1px solid rgba(157, 22, 149, .22);
}

.ira-sponsor-avatar {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--ira-primary), var(--ira-primary-2));
}

.ira-sponsor-name { font-size: 14px; font-weight: 700; color: var(--ira-text); }
.ira-sponsor-role { font-size: 12.5px; color: var(--ira-muted); }

/* package picker */

.ira-packages { display: grid; gap: 10px; margin-bottom: 6px; }

.ira-package {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--ira-radius-sm);
    border: 1.5px solid var(--ira-field-line);
    background: var(--ira-field-bg);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.ira-package:hover { border-color: var(--ira-primary-2); }

.ira-package input { position: absolute; opacity: 0; pointer-events: none; }

.ira-package.is-selected {
    border-color: var(--ira-primary);
    box-shadow: 0 0 0 4px rgba(157, 22, 149, .12);
}

.ira-package-name { font-size: 14.5px; font-weight: 700; color: var(--ira-text); }
.ira-package-meta { font-size: 12.5px; color: var(--ira-muted); }
.ira-package-price { font-size: 15px; font-weight: 700; color: var(--ira-primary); }

/* responsive ---------------------------------------------------------- */

@media (max-width: 1024px) {
    .ira-shell { grid-template-columns: 1fr; }

    .ira-brand {
        padding: 30px 26px 34px;
        min-height: auto;
    }

    .ira-brand-headline { font-size: 27px; margin: 18px 0 10px; max-width: none; }
    .ira-brand-sub { font-size: 14.5px; }
    .ira-brand-list,
    .ira-brand-foot { display: none; }

    .ira-panel { padding: 34px 22px 56px; align-items: flex-start; }
    .ira-topbar { top: 22px; inset-inline-end: 20px; }
    .ira-chip { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: #fff; }
}

@media (max-width: 480px) {
    .ira-row { grid-template-columns: 1fr; }
    .ira-title { font-size: 25px; }
    .ira-panel { padding: 28px 18px 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .ira-btn, .ira-input, .ira-select, .ira-package { transition: none; }
}

/* --------------------------------------------------------------------------
   Language picker in the auth topbar
   The shared Livewire selector hardcodes Tailwind light utilities
   (bg-white, border-gray-300, text-gray-700). Dropped onto the dark auth
   panel that renders as white-on-white and the current locale is unreadable.
   Re-skin it with the auth tokens so it works in both themes.
   -------------------------------------------------------------------------- */

.ira-topbar > div[x-data] > button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--ira-text) !important;
    background: var(--ira-surface) !important;
    border: 1px solid var(--ira-line) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    cursor: pointer;
}

.ira-topbar > div[x-data] > button:hover {
    border-color: var(--ira-primary) !important;
    background: var(--ira-surface) !important;
}

.ira-topbar > div[x-data] > button svg { color: var(--ira-muted) !important; }

/* dropdown panel */
.ira-topbar > div[x-data] > div {
    width: 200px !important;
    inset-inline-end: 0;
    left: auto !important;
    right: 0 !important;
    background: var(--ira-surface) !important;
    border: 1px solid var(--ira-line) !important;
    border-radius: var(--ira-radius-sm) !important;
    box-shadow: var(--ira-shadow) !important;
    max-height: 320px;
    overflow-y: auto;
    z-index: 60;
}

.ira-topbar > div[x-data] > div button {
    color: var(--ira-text) !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 9px 14px !important;
    white-space: nowrap;
}

.ira-topbar > div[x-data] > div button:hover {
    background: var(--ira-primary-soft) !important;
    color: var(--ira-primary) !important;
}

/* Alpine has not booted on first paint - without this the dropdown
   renders open over the form. */
[x-cloak] { display: none !important; }
