/* =====================================================================
   Sign-in pages (main user /Account/Login and event link /Portal/{token}).
   Left: purple gradient hero. Right: white sign-in form.
   ===================================================================== */

:root {
    --auth-primary: #3B1E54;
    --auth-primary-hover: #2C1640;
    --auth-gradient: linear-gradient(135deg, #7A2848 0%, #4B2157 40%, #3B1E54 65%, #722A4F 100%);
    --auth-text: #1F1A2E;
    --auth-muted: #6B6578;
    --auth-border: #E6E3EC;
    --auth-input-bg: #F8F8FB;
    --auth-danger: #B4234D;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
}

body.auth-page {
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--auth-text);
    background: #fff;
}

.auth-layout {
    display: grid;
    grid-template-columns: 55fr 45fr;
    min-height: 100vh;
}

/* ---------- Left hero ---------- */
.auth-hero {
    position: relative;
    overflow: hidden;
    background: var(--auth-gradient);
    color: #fff;
    padding: 3.5rem 4.5rem 2.5rem;
    display: flex;
    flex-direction: column;
}

.auth-hero::before,
.auth-hero::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.auth-hero::before { width: 760px; height: 760px; right: -380px; top: -200px; }
.auth-hero::after  { width: 520px; height: 520px; left: -300px; bottom: -280px; }

.auth-brand {
    position: relative;
    z-index: 1;
}

.auth-brand img {
    max-height: 90px;
    max-width: 260px;
}

.auth-brand .brand-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.auth-brand .brand-sub {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 0.25rem;
}

.auth-hero-body {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 2.5rem 0;
    max-width: 640px;
}

.auth-hero h1 {
    font-size: clamp(2rem, 3.6vw, 3.4rem);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 0 0 1.25rem;
}

.auth-hero .lead {
    font-size: 1.15rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
    margin: 0 0 2rem;
}

.auth-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-features li {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.auth-features .check {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.auth-footer {
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ---------- Right form ---------- */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.auth-form {
    width: 100%;
    max-width: 420px;
}

.auth-form h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
}

.auth-form .subtitle {
    color: var(--auth-muted);
    margin: 0 0 2rem;
}

.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.45rem;
}

.auth-label {
    font-weight: 600;
    font-size: 0.92rem;
}

.auth-label .req { color: var(--auth-danger); margin-left: 2px; }

.auth-link {
    color: var(--auth-primary);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
}

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

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

.auth-input {
    width: 100%;
    height: 50px;
    padding: 0 1rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--auth-text);
    background: var(--auth-input-bg);
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.auth-input-wrap .auth-input { padding-right: 4.5rem; }

.auth-input::placeholder { color: #9A94A6; }

.auth-input:focus {
    background: #fff;
    border-color: #9C7FB8;
    box-shadow: 0 0 0 3px rgba(59, 30, 84, 0.15);
}

.auth-input.input-validation-error { border-color: var(--auth-danger); }

.auth-toggle {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    color: var(--auth-muted);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: inherit;
}

.auth-toggle:hover { color: var(--auth-primary); }

.field-error {
    display: block;
    color: var(--auth-danger);
    font-size: 0.82rem;
    margin-top: 0.35rem;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--auth-muted);
    margin: -0.25rem 0 1.25rem;
}

.auth-remember input { accent-color: var(--auth-primary); width: 16px; height: 16px; }

.auth-button {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-primary);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s;
}

.auth-button:hover { background: var(--auth-primary-hover); }

.auth-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 30, 84, 0.3);
}

.auth-divider {
    border: 0;
    border-top: 1px solid var(--auth-border);
    margin: 2rem 0 1.25rem;
}

.auth-note {
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.92rem;
}

.auth-alert {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-alert:empty,
.auth-alert.validation-summary-valid { display: none; }

.auth-alert ul { margin: 0; padding-left: 1.1rem; }

.auth-alert-error { background: #FBEAF0; color: #8E1C3D; border: 1px solid #F2C9D6; }
.auth-alert-info  { background: #EFE9F5; color: var(--auth-primary); border: 1px solid #DCCFE8; }
.auth-alert-success { background: #E8F5EE; color: #1E6B45; border: 1px solid #C9E7D6; }

[hidden] { display: none !important; }

/* ---------- Registration: wider form, two columns ---------- */
.auth-form-wide { max-width: 640px; }

.auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
}

.auth-grid .span-2 { grid-column: 1 / -1; }

select.auth-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236B6578' stroke-width='1.6' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.auth-section {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--auth-muted);
    margin: 0.5rem 0 0.9rem;
}

/* Tom Select (searchable country) styled like the other inputs */
.auth-form .ts-wrapper.auth-input { padding: 0; height: auto; border: 0; background: none; box-shadow: none; }
.auth-form .ts-control {
    min-height: 50px;
    padding: 0 1rem;
    font-size: 1rem;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-input-bg);
    box-shadow: none;
    display: flex;
    align-items: center;
}
.auth-form .ts-wrapper.focus .ts-control {
    background: #fff;
    border-color: #9C7FB8;
    box-shadow: 0 0 0 3px rgba(59, 30, 84, 0.15);
}
.auth-form .ts-dropdown { border-radius: 8px; border-color: var(--auth-border); font-size: 0.95rem; }
.auth-form .ts-dropdown .active { background: #EFE9F5; color: var(--auth-primary); }
.auth-form .ts-dropdown .optgroup-header { font-weight: 600; color: var(--auth-muted); }

@media (max-width: 600px) {
    .auth-grid { grid-template-columns: 1fr; }
}

/* ---------- Small screens: hero becomes a compact banner ---------- */
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-hero { padding: 2rem 1.5rem; }
    .auth-hero-body { padding: 1.5rem 0 0.5rem; }
    .auth-hero h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
    .auth-hero .lead, .auth-features, .auth-footer { display: none; }
    .auth-panel { padding: 2rem 1rem 3rem; }
}
