/* ==========================================================================
   TalentHub – Auth Pages (Login, Register, Accept Invitation)
   Scoped styles only. Design tokens from home.css, shared components from global.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page Base & Layout
   -------------------------------------------------------------------------- */
.auth-page {
    /* Brand tokens are shared via portal-tokens.css — do NOT duplicate here. */

    min-height: 100vh;
    background: var(--background);
    color: var(--text-primary);
}

.auth-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 42%) minmax(0, 58%);
}

/* --------------------------------------------------------------------------
   2. Brand Panel (Left Column — Desktop)
   -------------------------------------------------------------------------- */
.auth-brand {
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px clamp(32px, 5vw, 76px);
    overflow: hidden;
    background: linear-gradient(160deg, #1A1122 0%, #291428 50%, #160D1E 100%);
    color: #fff;
}

.auth-brand::before {
    content: '';
    position: absolute;
    left: -60px;
    top: 20%;
    width: 220px;
    height: 220px;
    border: 32px solid rgba(161, 79, 201, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    right: -70px;
    bottom: 13%;
    width: 190px;
    height: 190px;
    border: 38px solid rgba(255, 107, 69, 0.14);
    border-radius: 50%;
    pointer-events: none;
}

.auth-brand__logo,
.auth-mobile-logo {
    display: inline-flex;
    align-items: center;
    width: max-content;
    text-decoration: none;
}

.auth-brand__logo {
    padding: 8px 14px;
    border-radius: var(--radius-sm, 8px);
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-brand__logo:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.20);
}

.auth-brand__logo-img {
    display: block;
    width: 178px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    aspect-ratio: 401 / 122;
}

.auth-mobile-logo {
    display: none;
    margin-bottom: 28px;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.auth-mobile-logo:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.auth-mobile-logo__img {
    display: block;
    width: 178px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    aspect-ratio: 401 / 122;
}

.auth-brand__content {
    position: relative;
    z-index: 1;
    max-width: 570px;
    margin: 64px 0;
}

.auth-eyebrow,
.auth-kicker {
    margin: 0 0 12px;
    color: var(--primary, #FF6B45);
    font-size: var(--text-xs);
    font-weight: var(--font-extrabold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.auth-brand h1 {
    max-width: 540px;
    margin: 0;
    color: #F8FAFC;
    font-size: clamp(var(--text-4xl), 4vw, var(--text-6xl));
    font-weight: var(--font-extrabold);
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.auth-brand__content > p:not(.auth-eyebrow) {
    max-width: 520px;
    margin: 28px 0 0;
    color: #CBD5E1;
    font-size: var(--text-base);
    line-height: 1.75;
}

.auth-brand__footer {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #94A3B8;
    font-size: var(--text-sm);
}

/* Role list in brand panel */
.auth-role-list {
    display: grid;
    gap: 10px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.auth-role-list li {
    display: grid;
    grid-template-columns: 12px 92px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    transition: all var(--transition-fast);
}

.auth-role-list li:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 107, 69, 0.35);
}

.auth-role-list strong { font-size: var(--text-sm); color: #FFFFFF; }
.auth-role-list li > span:last-child { color: #CBD5E1; font-size: var(--text-sm); }

.auth-role-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #FF6B45;
    box-shadow: 0 0 6px rgba(255, 107, 69, 0.5);
}

.auth-role-dot--student  { background: #FF6B45; box-shadow: 0 0 6px rgba(255, 107, 69, 0.6); }
.auth-role-dot--teacher  { background: #F83F70; box-shadow: 0 0 6px rgba(248, 63, 112, 0.6); }
.auth-role-dot--school   { background: #A14FC9; box-shadow: 0 0 6px rgba(161, 79, 201, 0.6); }
.auth-role-dot--business { background: #8B4DE8; box-shadow: 0 0 6px rgba(139, 77, 232, 0.6); }

/* Data summary in brand panel */
.auth-data-summary {
    display: grid;
    gap: 12px;
    margin-top: 32px;
}

.auth-data-summary p {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 13px 16px;
    border-left: 3px solid #FF6B45;
    background: rgba(255, 107, 69, 0.08);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.auth-data-summary strong { font-size: var(--text-base); color: #FFFFFF; }
.auth-data-summary span   { color: #CBD5E1; font-size: var(--text-base); line-height: var(--leading-relaxed); }
.auth-data-summary p:nth-child(1) { border-left-color: #FF6B45; background: rgba(255, 107, 69, 0.08); }
.auth-data-summary p:nth-child(2) { border-left-color: #F83F70; background: rgba(248, 63, 112, 0.08); }
.auth-data-summary p:nth-child(3) { border-left-color: #A14FC9; background: rgba(161, 79, 201, 0.08); }

/* --------------------------------------------------------------------------
   3. Auth Panel (Right Column — Form Area)
   -------------------------------------------------------------------------- */
.auth-panel {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    padding: 40px clamp(20px, 5vw, 64px);
    background: var(--background, #FDF7F1);
}

.auth-panel__inner {
    width: 100%;
    max-width: 490px;
    background: var(--surface, #FFFFFF);
    border: 1px solid var(--border, #F0E6DD);
    border-radius: var(--radius-xl, 20px);
    padding: clamp(28px, 4vw, 44px);
    box-shadow: 0 4px 24px rgba(50, 32, 20, 0.04), 0 1px 2px rgba(50, 32, 20, 0.02);
}

.auth-panel__inner--wide {
    max-width: 740px;
}

.auth-mobile-logo {
    display: none;
    margin-bottom: 32px;
}

/* --------------------------------------------------------------------------
   4. Heading Block
   -------------------------------------------------------------------------- */
.auth-heading { margin-bottom: 28px; }

.auth-heading__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.auth-heading h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(var(--text-3xl), 3vw, var(--text-4xl));
    font-weight: var(--font-extrabold);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.auth-heading > p:last-child,
.auth-heading__row + p {
    margin: 10px 0 0;
    color: var(--text-secondary);
    font-size: var(--text-md);
    line-height: var(--leading-relaxed);
}

.auth-role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 12px;
    border: 1px solid #FFDACB;
    border-radius: var(--radius-full);
    background: #FFF0EB;
    color: #E04058;
    font-size: var(--text-xs);
    font-weight: var(--font-extrabold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   5. Alert Messages (auth-specific, scoped to avoid conflict with .alert)
   -------------------------------------------------------------------------- */
.auth-alert {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: var(--radius-sm, 10px);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-alert:focus {
    outline: 3px solid rgba(255, 107, 69, 0.25);
    outline-offset: 2px;
}

.auth-alert strong { font-weight: var(--font-extrabold); }

.auth-alert ul {
    display: grid;
    gap: 4px;
    margin: 8px 0 0;
    padding-left: 20px;
}

.auth-alert a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-alert--error {
    border-color: #FECACA;
    border-left: 4px solid #DC2626;
    background: #FFF5F5;
    color: #991B1B;
}

.auth-alert--warning {
    border-color: #FDE68A;
    border-left: 4px solid #FF6B45;
    background: #FFF9EB;
    color: #92400E;
}

.auth-alert--success {
    border-color: #BBF7D0;
    border-left: 4px solid #16A34A;
    background: #F0FDF4;
    color: #166534;
}

/* --------------------------------------------------------------------------
   6. Form Structure
   -------------------------------------------------------------------------- */
.auth-form {
    display: grid;
    gap: 20px;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.auth-field {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
}

.auth-field--full { grid-column: 1 / -1; }

.auth-field label {
    color: var(--text-primary, #322014);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
}

.auth-field__label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --------------------------------------------------------------------------
   7. Input Fields
   -------------------------------------------------------------------------- */
.auth-field input,
.auth-field select,
.auth-page .typeui-select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--border-strong, #E5D7CC);
    border-radius: var(--radius-sm, 10px);
    outline: none;
    background-color: #FFFFFF;
    color: var(--text-primary, #322014);
    font-family: var(--font-primary);
    font-size: var(--text-md);
    box-shadow: 0 1px 2px rgba(50, 32, 20, 0.04) inset;
    transition:
        border-color var(--transition-fast),
        box-shadow   var(--transition-fast),
        background-color var(--transition-fast);
}

.auth-field select,
.auth-page .typeui-select,
.auth-page select.typeui-select {
    padding-right: 38px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239E897D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    cursor: pointer;
}

.auth-field input:hover:not(:disabled):not([aria-invalid]),
.auth-field select:hover:not(:disabled),
.auth-page .typeui-select:hover:not(:disabled) {
    border-color: var(--primary, #FF6B45);
}

.auth-field input:focus,
.auth-field select:focus,
.auth-page .typeui-select:focus {
    border-color: var(--primary, #FF6B45);
    background-color: var(--surface, #FFFFFF);
    box-shadow:
        0 0 0 3.5px rgba(255, 107, 69, 0.20),
        0 1px 2px rgba(50, 32, 20, 0.04) inset;
    outline: none;
}

.auth-field input[aria-invalid="true"],
.auth-field select[aria-invalid="true"],
.auth-page .typeui-select[aria-invalid="true"] {
    border-color: var(--color-danger, #DC2626);
    background-color: #FFF8F8;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.auth-field input:disabled,
.auth-field select:disabled,
.auth-page .typeui-select:disabled,
.auth-page select.typeui-select:disabled {
    cursor: not-allowed;
    background-color: var(--background, #FDF7F1);
    color: var(--text-disabled, #B8A599);
    border-color: var(--border, #F0E6DD);
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    opacity: 0.85;
}

.auth-field__hint,
.auth-field__error {
    min-height: 18px;
    font-size: var(--text-xs);
    line-height: var(--leading-snug);
}

.auth-field__hint {
    color: var(--text-muted, #9E897D);
}

.auth-field__error {
    color: #DC2626;
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   8. Password Toggle
   -------------------------------------------------------------------------- */
.auth-password { position: relative; }

.auth-password input { padding-right: 64px; }

.auth-password__toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    min-width: 48px;
    min-height: 38px;
    padding: 0 10px;
    transform: translateY(-50%);
    border-radius: var(--radius-xs, 6px);
    background: #FFF0EB;
    border: 1px solid #FFDACB;
    color: #FF6B45;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password__toggle:hover {
    background: #FF6B45;
    border-color: #FF6B45;
    color: #FFFFFF;
}

.auth-password__toggle:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 107, 69, 0.25);
    outline: none;
}

/* --------------------------------------------------------------------------
   9. Submit Button
   -------------------------------------------------------------------------- */
.auth-submit {
    display: flex;
    width: 100%;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-md, 12px);
    background: linear-gradient(135deg, #FF6B45 0%, #F83F70 25%, #F23585 50%, #A14FC9 75%, #8B4DE8 100%);
    color: var(--text-inverse, #FFFFFF);
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-extrabold);
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow:
        0 4px 14px rgba(248, 63, 112, 0.35),
        0 2px 6px rgba(255, 107, 69, 0.20);
    transition: all var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1));
}

.auth-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #F83F70 0%, #F23585 28%, #A14FC9 65%, #8B4DE8 100%);
    box-shadow:
        0 6px 20px rgba(248, 63, 112, 0.45),
        0 3px 8px rgba(255, 107, 69, 0.25);
    transform: translateY(-2px);
}

.auth-submit:focus-visible {
    box-shadow:
        0 0 0 3.5px rgba(248, 63, 112, 0.35),
        0 4px 14px rgba(248, 63, 112, 0.35);
    outline: none;
}

.auth-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(248, 63, 112, 0.30);
}

.auth-submit:disabled {
    cursor: not-allowed;
    background: var(--border-strong, #E5D7CC);
    color: var(--text-muted, #9E897D);
    box-shadow: none;
    transform: none;
}

.auth-submit.is-loading { justify-content: center; }
.auth-submit.is-loading span:last-child { display: none; }

.auth-demo {
    margin: 0 0 22px;
    padding: 14px;
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border, #F0E6DD);
    background: var(--background, #FDF7F1);
}

.auth-demo__title {
    margin: 0 0 4px;
    color: var(--text-secondary, #6B5548);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.auth-demo__hint {
    margin: 0 0 12px;
    color: var(--text-muted, #9E897D);
    font-size: var(--text-xs);
    line-height: 1.4;
}

.auth-demo__open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #FFDACB;
    border-radius: var(--radius-sm, 8px);
    background: #FFFFFF;
    color: var(--primary, #FF6B45);
    font-size: var(--text-sm);
    font-weight: var(--font-extrabold);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.auth-demo__open:hover {
    border-color: var(--primary, #FF6B45);
    box-shadow: 0 2px 10px rgba(255, 107, 69, 0.16);
    transform: translateY(-1px);
}

.auth-demo__open:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 69, 0.25);
}

.auth-demo-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    place-items: center;
    padding: 16px;
    pointer-events: none;
}

.auth-demo-modal.is-open {
    display: grid;
    pointer-events: auto;
}

.auth-demo-modal[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.auth-demo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 17, 34, 0.55);
    backdrop-filter: blur(2px);
}

.auth-demo-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(760px, 100%);
    max-height: min(86vh, 920px);
    overflow: hidden;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 24px 64px rgba(26, 17, 34, 0.28);
}

.auth-demo-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex: 0 0 auto;
    padding: 20px 22px 12px;
    border-bottom: 1px solid var(--border, #F0E6DD);
}

.auth-demo-modal__header h2 {
    margin: 0 0 4px;
    font-size: var(--text-xl);
    color: var(--text-primary, #322014);
}

.auth-demo-modal__header p {
    margin: 0;
    color: var(--text-secondary, #6B5548);
    font-size: var(--text-sm);
    line-height: 1.45;
}

.auth-demo-modal__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #F7EFE8;
    color: #6B5548;
    font-size: var(--text-2xl);
    line-height: 1;
    cursor: pointer;
}

.auth-demo-modal__close:hover {
    background: #FFE4D8;
    color: #FF6B45;
}

.auth-demo-modal__tabs {
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 4px;
    min-height: 48px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 12px;
    border-bottom: 1px solid var(--border, #F0E6DD);
    background: #FDFBF8;
    -webkit-overflow-scrolling: touch;
}

.auth-demo-modal__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: var(--text-secondary, #6B5548);
    font-family: inherit;
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.auth-demo-modal__tab > span:not(.auth-role-dot) {
    display: inline-block;
    line-height: 1.2;
}

.auth-demo-modal__tab em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    min-width: 1.4rem;
    height: 1.25rem;
    padding: 0 6px;
    border-radius: 999px;
    background: #F1ECE8;
    color: #7A6A60;
    font-size: var(--text-2xs);
    line-height: 1;
}

.auth-demo-modal__tab:hover {
    color: var(--text-primary, #322014);
}

.auth-demo-modal__tab.is-active {
    color: var(--primary, #FF6B45);
    border-bottom-color: var(--primary, #FF6B45);
}

.auth-demo-modal__tab.is-active em {
    background: #FFE4D8;
    color: #FF6B45;
}

.auth-demo-modal__tab .auth-role-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
}

.auth-demo-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px 18px 22px;
}

.auth-demo-modal__panel[hidden] {
    display: none !important;
}

.auth-demo-modal__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.auth-demo-modal__card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border: 1px solid var(--border, #F0E6DD);
    border-radius: 12px;
    background: #FDFBF8;
}

.auth-demo-modal__identity {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.auth-demo-modal__identity strong {
    color: var(--text-primary, #322014);
    font-size: var(--text-sm);
}

.auth-demo-modal__email {
    color: var(--text-muted, #9E897D);
    font-size: var(--text-xs);
    word-break: break-all;
}

.auth-demo-modal__desc {
    color: var(--text-secondary, #6B5548);
    font-size: var(--text-xs);
    line-height: 1.4;
}

.auth-demo-modal__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.auth-demo-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: var(--text-2xs);
    font-weight: 700;
    line-height: 1.4;
}

.auth-demo-badge--success {
    background: #E8F7EF;
    color: #147A45;
}

.auth-demo-badge--warn {
    background: #FFF4E5;
    color: #A15C00;
}

.auth-demo-badge--muted {
    background: #F1ECE8;
    color: #7A6A60;
}

.auth-demo-modal__status {
    margin: 8px 0 0;
    padding-left: 16px;
    color: var(--text-secondary, #6B5548);
    font-size: var(--text-xs);
    line-height: 1.45;
}

.auth-demo-modal__status li + li {
    margin-top: 2px;
}

.auth-demo-modal__login {
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--primary, #FF6B45);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: var(--font-extrabold);
    white-space: nowrap;
    cursor: pointer;
}

.auth-demo-modal__login:hover {
    filter: brightness(0.96);
}

.auth-demo-modal__login:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 69, 0.28);
}

.auth-role-dot--admin {
    background: #64748B;
    box-shadow: 0 0 6px rgba(100, 116, 139, 0.5);
}

body.auth-demo-modal-open {
    overflow: hidden;
}

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

    .auth-demo-modal__login {
        width: 100%;
    }
}

/* --------------------------------------------------------------------------
   10. Links & Helpers
   -------------------------------------------------------------------------- */
.auth-switch {
    margin: 24px 0 0;
    text-align: center;
    color: var(--text-secondary, #6B5548);
    font-size: var(--text-base);
}

.auth-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 0.25rem;
    color: var(--primary, #FF6B45);
    font-weight: var(--font-extrabold);
    transition: color var(--transition-fast);
}

.auth-switch a:hover {
    color: var(--primary-coral, #F83F70);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-switch a:focus-visible {
    outline: 2px solid var(--primary, #FF6B45);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: max-content;
    min-height: 44px;
    margin: 20px auto 0;
    padding-inline: 0.5rem;
    color: var(--text-secondary, #6B5548);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    transition: gap var(--transition-fast), color var(--transition-fast);
}

.auth-back:hover {
    gap: 0.625rem;
    color: var(--primary, #FF6B45);
}

.auth-back:focus-visible {
    outline: 2px solid var(--primary, #FF6B45);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------------------
   11. Register Page Variations
   -------------------------------------------------------------------------- */
.auth-page--register .auth-panel {
    padding-top: 28px;
    padding-bottom: 28px;
}

.auth-page--register .auth-brand__content { margin: 44px 0; }

.auth-page--register .auth-brand h1 {
    font-size: clamp(var(--text-3xl), 3.4vw, var(--text-5xl));
}

.auth-page--register .auth-form-grid { gap: 16px 18px; }
.auth-page--register .auth-submit    { margin-top: 4px; }

/* Form section divider */
.auth-form-section {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    padding: 14px 0 2px;
    border-top: 1px solid var(--border, #F0E6DD);
}

.auth-form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.auth-form-section > span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: var(--radius-sm, 8px);
    background: #FFF0EB;
    border: 1px solid #FFDACB;
    color: #FF6B45;
    font-size: var(--text-xs);
    font-weight: var(--font-extrabold);
    box-shadow: 0 2px 6px rgba(255, 107, 69, 0.08);
}

.auth-form-section > div   { display: grid; gap: 2px; }
.auth-form-section strong  { color: var(--text-primary, #322014); font-size: var(--text-sm); }
.auth-form-section small   { color: var(--text-secondary, #6B5548); font-size: var(--text-xs); line-height: var(--leading-snug); }

/* Organization type switch */
.org-type-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 0 0 22px;
    padding: 5px;
    border-radius: var(--radius-sm);
    background: var(--background, #FDF7F1);
    border: 1px solid var(--border, #F0E6DD);
}

.org-type-switch a {
    padding: 10px;
    text-align: center;
    border-radius: var(--radius-xs);
    color: var(--text-secondary, #6B5548);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    transition: all var(--transition-fast);
}

.org-type-switch a.is-active {
    background: #ffffff;
    color: var(--primary, #FF6B45);
    border: 1px solid rgba(255, 107, 69, 0.25);
    box-shadow: 0 1px 4px rgba(255, 107, 69, 0.15);
}

/* --------------------------------------------------------------------------
   12. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-brand  { display: none; }

    .auth-panel {
        min-height: 100vh;
        padding: 32px 22px;
        align-items: flex-start;
    }

    .auth-mobile-logo { display: inline-flex; }
    .auth-panel__inner { max-width: 520px; }
    .auth-panel__inner--wide { max-width: 680px; }
}

@media (max-width: 768px) {
    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-field--full { grid-column: auto; }
}

@media (max-width: 620px) {
    .auth-panel { padding: 24px 16px 32px; }
    .auth-mobile-logo { margin-bottom: 32px; }

    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .auth-field--full { grid-column: auto; }
    .auth-heading__row { align-items: center; }
    .auth-heading h2   { font-size: var(--text-2xl); }
    .auth-page--register .auth-panel { padding-top: 22px; }

    /* Prevent iOS zoom on input focus */
    .auth-field input,
    .auth-field select {
        font-size: var(--text-lg);
    }
}

/* --------------------------------------------------------------------------
   13. Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   AUTH UI/UX UPGRADE PATCH
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout: tránh overflow trên 900-1024px (zone bị cắt)
   -------------------------------------------------------------------------- */
@media (min-width: 901px) and (max-width: 1024px) {
    .auth-layout {
        grid-template-columns: minmax(280px, 38%) minmax(0, 62%);
    }

    .auth-brand {
        padding: 32px clamp(20px, 3vw, 48px);
    }

    .auth-brand h1 {
        font-size: clamp(var(--text-3xl), 3vw, var(--text-5xl));
    }
}

/* --------------------------------------------------------------------------
   Submit button: trạng thái active rõ ràng hơn
   -------------------------------------------------------------------------- */
.auth-submit:active:not(:disabled) {
    transform: scale(0.99) translateY(1px);
    box-shadow: none;
    background: var(--primary-dark);
}

/* Disabled state: màu rõ hơn */
.auth-submit:disabled {
    background: var(--border-strong);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* --------------------------------------------------------------------------
   Org type switch: border-radius nhất quán
   -------------------------------------------------------------------------- */
.org-type-switch {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

.org-type-switch a {
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --------------------------------------------------------------------------
   Form grid: gap trên màn hình rất nhỏ
   -------------------------------------------------------------------------- */
@media (max-width: 380px) {
    .auth-form-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .auth-field--full {
        grid-column: auto;
    }
}

/* --------------------------------------------------------------------------
   Brand panel: overflow text protection
   -------------------------------------------------------------------------- */
.auth-brand h1 {
    overflow-wrap: anywhere;
    hyphens: auto;
}

.auth-brand__content > p {
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Form field input: focus ring sắc nét chuẩn Brand
   -------------------------------------------------------------------------- */
.auth-field input:focus,
.auth-field select:focus,
.auth-page .typeui-select:focus {
    border-color: var(--primary, #FF6B45);
    box-shadow:
        0 0 0 3.5px rgba(255, 107, 69, 0.20),
        0 1px 2px rgba(50, 32, 20, 0.04) inset;
    background: var(--surface, #ffffff);
}

/* --------------------------------------------------------------------------
   Auth panel: padding tối thiểu trên màn rất nhỏ
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
    .auth-panel {
        padding: 16px 12px 24px;
    }

    .auth-heading h2 {
        font-size: var(--text-2xl);
    }
}

/* --------------------------------------------------------------------------
   Mobile logo: margin nhất quán
   -------------------------------------------------------------------------- */
.auth-mobile-logo {
    margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   Form section divider: cải thiện visual
   -------------------------------------------------------------------------- */
.auth-form-section {
    margin-top: 8px;
    padding-top: 14px;
}

.auth-form-section > span {
    border-radius: var(--radius-sm, 8px);
    background: #FFF0EB;
    border: 1px solid #FFDACB;
    color: #FF6B45;
    box-shadow: 0 2px 6px rgba(255, 107, 69, 0.08);
}

/* --------------------------------------------------------------------------
   Alert: thêm icon placeholder space
   -------------------------------------------------------------------------- */
.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: var(--leading-relaxed);
}

/* --------------------------------------------------------------------------
   Role badge: overflow protection
   -------------------------------------------------------------------------- */
.auth-role-badge {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Password toggle: touch target đủ 44px
   -------------------------------------------------------------------------- */
.auth-password__toggle {
    min-width: 44px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   AUTH VISUAL POLISH — BRAND SYNCHRONIZED
   ========================================================================== */

/* Brand panel: rich warm dark gradient with sunset depth */
.auth-brand {
    background: linear-gradient(160deg, #1A1122 0%, #291428 50%, #160D1E 100%);
}

/* Decorative circles on brand panel */
.auth-brand::before {
    content: '';
    position: absolute;
    left: -60px;
    top: 20%;
    width: 220px;
    height: 220px;
    border: 32px solid rgba(161, 79, 201, 0.12);
    border-radius: 50%;
    pointer-events: none;
}


/* Auth eyebrow / kicker */
.auth-eyebrow,
.auth-kicker {
    color: var(--primary, #FF6B45);
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
}

/* Brand h1: softer white */
.auth-brand h1 {
    color: #F8FAFC;
    font-weight: var(--font-extrabold);
    letter-spacing: -0.02em;
}

/* Role list: glass effect with warm hover */
.auth-role-list li {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(8px);
    transition: all var(--transition-fast);
}

.auth-role-list li:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 107, 69, 0.35);
}

/* Panel: warm light canvas */
.auth-panel {
    background: var(--background, #FDF7F1);
}

/* Heading h2: warm dark text */
.auth-heading h2 {
    color: var(--text-primary, #322014);
    background: none;
    -webkit-text-fill-color: initial;
}

/* Input fields: polished warm borders */
.auth-field input,
.auth-field select,
.auth-page .typeui-select {
    border: 1.5px solid var(--border-strong, #E5D7CC);
    border-radius: var(--radius-sm, 10px);
    box-shadow: 0 1px 2px rgba(50, 32, 20, 0.04) inset;
    transition: all var(--transition-fast);
}

.auth-field input:hover:not(:disabled):not([aria-invalid]),
.auth-field select:hover:not(:disabled),
.auth-page .typeui-select:hover:not(:disabled) {
    border-color: var(--primary, #FF6B45);
}

.auth-field input:focus,
.auth-field select:focus,
.auth-page .typeui-select:focus {
    border-color: var(--primary, #FF6B45);
    background-color: var(--surface, #ffffff);
    box-shadow:
        0 0 0 3.5px rgba(255, 107, 69, 0.20),
        0 1px 2px rgba(50, 32, 20, 0.04) inset;
}

/* Submit button: Sunset Coral Brand Gradient */
.auth-submit {
    background: linear-gradient(135deg, #FF6B45 0%, #F83F70 25%, #F23585 50%, #A14FC9 75%, #8B4DE8 100%);
    border-radius: var(--radius-md, 12px);
    box-shadow:
        0 4px 14px rgba(248, 63, 112, 0.35),
        0 2px 6px rgba(255, 107, 69, 0.20);
    font-size: var(--text-base);
    font-weight: var(--font-extrabold);
    letter-spacing: 0.01em;
    transition: all var(--transition-fast, 0.2s cubic-bezier(0.4, 0, 0.2, 1));
}

.auth-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #F83F70 0%, #F23585 28%, #A14FC9 65%, #8B4DE8 100%);
    box-shadow:
        0 6px 20px rgba(248, 63, 112, 0.45),
        0 3px 8px rgba(255, 107, 69, 0.25);
    transform: translateY(-2px);
}

/* Password toggle */
.auth-password__toggle {
    background: #FFF0EB;
    border: 1px solid #FFDACB;
    color: #FF6B45;
    border-radius: var(--radius-xs, 6px);
    font-weight: var(--font-bold);
    font-size: var(--text-xs);
    padding: 0 0.625rem;
    transition: all var(--transition-fast);
}

.auth-password__toggle:hover {
    background: #FF6B45;
    border-color: #FF6B45;
    color: #ffffff;
}

/* Alert styles */
.auth-alert--error {
    border-color: #FECACA;
    border-left: 4px solid #DC2626;
    background: #FFF5F5;
    color: #991B1B;
    border-radius: var(--radius-sm, 10px);
}

.auth-alert--warning {
    border-color: #FDE68A;
    border-left: 4px solid #FF6B45;
    background: #FFF9EB;
    color: #92400E;
    border-radius: var(--radius-sm, 10px);
}

.auth-alert--success {
    border-color: #BBF7D0;
    border-left: 4px solid #16A34A;
    background: #F0FDF4;
    color: #166534;
    border-radius: var(--radius-sm, 10px);
}

/* Switch link */
.auth-switch a {
    color: var(--primary, #FF6B45);
    text-underline-offset: 3px;
    transition: color var(--transition-fast);
}

.auth-switch a:hover {
    color: var(--primary-coral, #F83F70);
    text-decoration: underline;
}

/* Auth back link */
.auth-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    color: var(--text-secondary, #6B5548);
    transition: gap var(--transition-fast), color var(--transition-fast);
}

.auth-back:hover {
    gap: 0.625rem;
    color: var(--primary, #FF6B45);
}

/* Org type switch */
.org-type-switch a.is-active {
    background: #ffffff;
    color: var(--primary, #FF6B45);
    border: 1px solid rgba(255, 107, 69, 0.25);
    box-shadow: 0 1px 4px rgba(255, 107, 69, 0.15);
}

/* Data summary: left border brand colors */
.auth-data-summary p:nth-child(1) {
    border-left-color: #FF6B45;
    background: rgba(255, 107, 69, 0.08);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.auth-data-summary p:nth-child(2) {
    border-left-color: #F83F70;
    background: rgba(248, 63, 112, 0.08);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

.auth-data-summary p:nth-child(3) {
    border-left-color: #A14FC9;
    background: rgba(161, 79, 201, 0.08);
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}

/* ==========================================================================
   AUTH UI/UX POLISH PATCH — SPACING, OVERFLOW & TYPOGRAPHY
   ========================================================================== */

/* ── Auth Layout Overflow Protection ── */
.auth-page,
.auth-layout {
    overflow-x: hidden;
}

/* ── Auth Brand Panel ── */
.auth-brand {
    padding: var(--space-8) clamp(var(--space-6), 5vw, var(--space-12));
}

.auth-brand__content {
    margin: var(--space-8) 0;
}

/* ── Auth Panel ── */
.auth-panel {
    padding: var(--space-8) clamp(var(--space-4), 5vw, var(--space-8));
}

.auth-panel__inner {
    padding: var(--space-6) clamp(var(--space-4), 4vw, var(--space-8));
}

/* ── Form Spacing ── */
.auth-form {
    gap: var(--space-5);
}

.auth-form-grid {
    gap: var(--space-4) var(--space-5);
}

@media (max-width: 620px) {
    .auth-form-grid {
        gap: var(--space-4);
    }
}

/* ── Field Spacing ── */
.auth-field {
    gap: var(--space-2);
}

/* ── Heading Spacing ── */
.auth-heading {
    margin-bottom: var(--space-6);
}

.auth-heading__row {
    gap: var(--space-5);
}

/* ── Alert Spacing ── */
.auth-alert {
    margin-bottom: var(--space-5);
    padding: var(--space-4);
    gap: var(--space-2);
}

/* ── Switch & Back Link ── */
.auth-switch {
    margin: var(--space-6) 0 0;
}

.auth-back {
    margin: var(--space-5) auto 0;
}

/* ── Submit Button ── */
.auth-submit {
    margin-top: var(--space-4);
}

/* ── Responsive Auth ── */
@media (max-width: 768px) {
    .auth-panel {
        padding: var(--space-6) var(--space-4);
    }
    
    .auth-panel__inner {
        padding: var(--space-5);
    }
    
    .auth-brand__content {
        margin: var(--space-6) 0;
    }
}

@media (max-width: 480px) {
    .auth-panel {
        padding: var(--space-4) var(--space-3);
    }
    
    .auth-panel__inner {
        padding: var(--space-4);
    }
    
    .auth-alert {
        padding: var(--space-3);
    }
}

/* ── Input Spacing ── */
.auth-field input,
.auth-field select,
.auth-page .typeui-select {
    padding: 0 var(--space-4);
}

/* ── Password Toggle ── */
.auth-password__toggle {
    right: var(--space-2);
    padding: 0 var(--space-3);
}

/* Form section divider icon */
.auth-form-section > span {
    background: #FFF0EB;
    border: 1px solid #FFDACB;
    color: #FF6B45;
    box-shadow: 0 2px 6px rgba(255, 107, 69, 0.08);
}
