/* Login, register, password reset — uses :root --hms-* from auth_hms_theme.blade.php */

/* Main column: breathing room below viewport top + iOS safe area (prevents logo clipped) */
.auth-app-shell .right-col {
    padding-top: max(1.25rem, env(safe-area-inset-top, 0px)) !important;
}
@media (min-width: 640px) {
    .auth-app-shell .right-col {
        padding-top: max(1.5rem, env(safe-area-inset-top, 0px)) !important;
    }
}
@media (min-width: 768px) {
    .auth-app-shell .right-col {
        padding-top: max(1.75rem, env(safe-area-inset-top, 0px)) !important;
    }
}
.auth-app-shell .container-fluid {
    overflow-x: hidden;
    overflow-y: visible;
}

/* layouts/auth.blade.php: header sits directly in .container-fluid (no .right-col) */
.auth-app-shell .container-fluid > header.auth-shell-topbar {
    margin-top: max(0.75rem, env(safe-area-inset-top, 0px));
}

/* Auth topbar: mobile = 2-row grid (logo + language | actions); md+ = single flex row */
.auth-shell-topbar {
    overflow: visible;
}
.auth-shell-topbar__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 0.5rem 0.5rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    align-items: center;
}
.auth-shell-topbar__grid-logo {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    overflow: visible;
}
.auth-shell-topbar__grid-lang {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    max-width: min(11rem, 42vw);
    min-width: 0;
}
.auth-shell-topbar__grid-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.35rem 0.5rem;
    min-width: 0;
}
@media (max-width: 767px) {
    .auth-shell-topbar__grid-logo,
    .auth-shell-topbar__grid-actions,
    .auth-shell-topbar__grid-lang {
        order: 0;
    }
}
@media (min-width: 768px) {
    .auth-shell-topbar__grid {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.75rem 1rem;
        min-height: 3rem;
    }
    /* DOM is logo → lang → actions; desktop should read: logo | actions | language */
    .auth-shell-topbar__grid-logo {
        flex: 0 0 auto;
        overflow: visible;
        order: 1;
    }
    .auth-shell-topbar__grid-actions {
        flex: 1 1 0%;
        min-width: 0;
        justify-content: flex-end;
        flex-wrap: nowrap;
        order: 2;
    }
    .auth-shell-topbar__grid-lang {
        flex: 0 0 auto;
        max-width: none;
        order: 3;
    }
}

/* Logo: never clip artwork; block img removes stray baseline gap */
.auth-app-shell .auth-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-sizing: border-box;
    overflow: visible;
    flex-shrink: 0;
}
.auth-app-shell .auth-logo-box img {
    display: block;
    max-height: 2.5rem;
    max-width: 2.5rem;
    width: auto;
    height: auto;
    object-fit: contain;
}
@media (min-width: 768px) {
    .auth-app-shell .auth-logo-box img {
        max-height: 3rem;
        max-width: 3rem;
    }
}

/* Language control: readable tap target; long names ellipsize on small screens */
.auth-shell-topbar__grid .tw-dw-dropdown {
    max-width: 100%;
}
.auth-shell-topbar__grid .tw-dw-dropdown > summary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.75rem;
    line-height: 1.25;
    list-style: none;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    padding: 0.125rem 0.25rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.auth-shell-topbar__grid .tw-dw-dropdown > summary::-webkit-details-marker {
    display: none;
}
@media (min-width: 768px) {
    .auth-shell-topbar__grid .tw-dw-dropdown > summary {
        font-size: 0.875rem;
        min-height: 2.25rem;
    }
}
.auth-shell-topbar__grid .tw-dw-dropdown .tw-dw-dropdown-content {
    z-index: 1080;
}

/* ─── Topbar pill / link helpers ─── */
.auth-shell-topbar__link {
    text-decoration: none;
}
.auth-shell-topbar__link:focus-visible,
.auth-shell-topbar__pill:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
    border-radius: 6px;
}
.auth-shell-topbar__pill {
    text-decoration: none;
    transition: background-color 0.15s ease;
}
.auth-shell-topbar__pill:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ─── jQuery Steps — Next / Finish ─── */
.auth-app-shell #business_register_form .actions a[href="#next"].tw-dw-btn-primary,
.auth-app-shell #business_register_form .actions a[href="#finish"].tw-dw-btn-primary,
.auth-app-shell .wizard .actions a[href="#next"].tw-dw-btn-primary,
.auth-app-shell .wizard .actions a[href="#finish"].tw-dw-btn-primary {
    background: var(--hms-primary) !important;
    border-color: var(--hms-primary) !important;
    color: #fff !important;
}
.auth-app-shell #business_register_form .actions a[href="#next"].tw-dw-btn-primary:hover,
.auth-app-shell #business_register_form .actions a[href="#finish"].tw-dw-btn-primary:hover,
.auth-app-shell .wizard .actions a[href="#next"].tw-dw-btn-primary:hover,
.auth-app-shell .wizard .actions a[href="#finish"].tw-dw-btn-primary:hover {
    filter: brightness(1.08);
}

/* ─── Register form field addon tint ─── */
.auth-app-shell #business_register_form .input-group-addon {
    background: color-mix(in srgb, var(--hms-primary) 10%, #f8fafc);
    border-color: color-mix(in srgb, var(--hms-primary) 22%, #dee2e6);
    color: var(--hms-primary-dark);
}
.auth-app-shell #business_register_form h3,
.auth-app-shell #business_register_form legend.text-black {
    color: var(--hms-primary-dark);
}

/* ─── Tailwind-styled input focus (legacy forms) ─── */
.auth-app-shell input.tw-rounded-lg:focus,
.auth-app-shell textarea.tw-rounded-lg:focus,
.auth-app-shell select.tw-rounded-lg:focus {
    border-color: var(--hms-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hms-primary) 14%, transparent) !important;
    outline: none;
}

/* ── Inline actions bar (between logo and card) ── */
.aes-actions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
/* Language select inside the bar */
.aes-lang-select {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.45);
    color: #fff;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}
.aes-lang-select:focus {
    border-color: rgba(255,255,255,0.75);
    outline: none;
}
.aes-lang-select option {
    color: #111;
    background: #fff;
}
.aes-actions-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.85rem;
    border: 1.5px solid rgba(255,255,255,0.75);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.aes-actions-pill:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    color: #fff;
    text-decoration: none;
}
.aes-actions-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.82);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}
.aes-actions-link:hover { color: #fff; text-decoration: none; }

/* ── Minimal top-right utility bar (replaces full topbar) ── */
.auth-topbar-utils {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.auth-topbar-link {
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: color 0.15s;
    white-space: nowrap;
}
.auth-topbar-link:hover { color: #fff; text-decoration: none; }
.auth-topbar-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.9rem;
    border: 1.5px solid rgba(255,255,255,0.75);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.auth-topbar-pill:hover {
    background: rgba(255,255,255,0.15);
    border-color: #fff;
    color: #fff;
    text-decoration: none;
}

/* =====================================================================
   ENTERPRISE AUTH DESIGN SYSTEM
   All auth pages: login · forgot · reset · register
   Uses CSS vars set by theme_chrome_vars.blade.php so colors auto-match
   the business theme setting (--hms-primary, --hms-primary-dark, etc.)
   ===================================================================== */

/* ── Page centring wrapper ── */
.aes-wrap {
    width: 100%;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.5rem;
    padding: 0 4px;
    box-sizing: border-box;
}
.aes-wrap--wide  { max-width: 840px; }
.aes-wrap--slim  { max-width: 420px; }

/* ── Branding block above the card ── */
.aes-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
.aes-brand__logo {
    display: inline-block;
    width: 62px;
    height: 62px;
    object-fit: contain;
    margin-bottom: 0.6rem;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.28));
}
.aes-brand__name {
    font-size: 1.45rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    letter-spacing: -0.025em;
    line-height: 1.1;
    text-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.aes-brand__tagline {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.72);
    margin: 0.3rem 0 0;
    font-weight: 400;
}

/* ── The white card ── */
.aes-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.10);
    padding: 2.25rem 2rem;
    width: 100%;
    box-sizing: border-box;
}
@media (min-width: 480px) {
    .aes-card { padding: 2.75rem 2.5rem; }
}
.aes-card__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hms-primary);
    margin: 0 0 0.5rem;
}
.aes-card__title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.3rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}
.aes-card__sub {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 2rem;
    line-height: 1.5;
}
.aes-card__footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.83rem;
    color: #64748b;
}
.aes-card__divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.5rem 0;
}

/* ── Card with gradient header (register · icon-top pages) ── */
.aes-headed-card {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 8px 48px rgba(0,0,0,0.22), 0 2px 6px rgba(0,0,0,0.10);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}
.aes-headed-card__head {
    background: var(--hms-primary);
    padding: 1.75rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    position: relative;
    overflow: hidden;
}
.aes-headed-card__head::after {
    content: '';
    position: absolute;
    bottom: -55px; right: -30px;
    width: 180px; height: 180px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    pointer-events: none;
}
.aes-headed-card__head img {
    width: 2.6rem; height: 2.6rem;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
    position: relative; z-index: 1;
}
.aes-headed-card__head-text { position: relative; z-index: 1; }
.aes-headed-card__head-text h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.15rem;
    line-height: 1.25;
}
.aes-headed-card__head-text p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.82);
    margin: 0;
}
.aes-headed-card__body { padding: 2rem; }

/* ── Icon-top variant (forgot / reset password) ── */
.aes-icon-head {
    background: var(--hms-primary);
    padding: 2.25rem 2rem 1.85rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.aes-icon-head::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 160px; height: 160px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    pointer-events: none;
}
.aes-icon-head__circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem; height: 3.5rem;
    background: rgba(255,255,255,0.22);
    border-radius: 50%;
    margin-bottom: 0.85rem;
    position: relative; z-index: 1;
}
.aes-icon-head__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.4rem;
    position: relative; z-index: 1;
}
.aes-icon-head__sub {
    font-size: 0.81rem;
    color: rgba(255,255,255,0.82);
    margin: 0;
    line-height: 1.55;
    position: relative; z-index: 1;
}
.aes-icon-head__back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    margin-top: 0.9rem;
    transition: color 0.15s;
    position: relative; z-index: 1;
}
.aes-icon-head__back:hover { color: #fff; text-decoration: none; }
.aes-icon-head__body { padding: 2rem; }

/* ── Form fields ── */
.aes-field { margin-bottom: 1.15rem; }
.aes-field__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.42rem;
}
.aes-field__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
    margin: 0;
    line-height: 1.25;
}
.aes-field__aside {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--hms-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
    flex-shrink: 0;
}
.aes-field__aside:hover { color: var(--hms-primary-dark); text-decoration: underline; }

.aes-field__input {
    display: block;
    width: 100%;
    height: 2.875rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 0 0.875rem;
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 400;
    color: #0f172a;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.aes-field__input:focus {
    border-color: var(--hms-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hms-primary) 18%, transparent);
}
.aes-field__input::placeholder { color: #94a3b8; font-weight: 400; }
.aes-field__input:-webkit-autofill,
.aes-field__input:-webkit-autofill:hover,
.aes-field__input:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a;
    box-shadow: 0 0 0 1000px #f8fafc inset,
                0 0 0 3px color-mix(in srgb, var(--hms-primary) 18%, transparent);
    transition: background-color 99999s ease-out;
}

/* Password field wrapper */
.aes-field__pwd {
    position: relative;
}
.aes-field__pwd .aes-field__input { padding-right: 3rem; }
.aes-field__pwd-toggle {
    position: absolute;
    right: 0.3rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    line-height: 0;
    z-index: 10;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s;
}
.aes-field__pwd-toggle:hover { color: #475569; }
.aes-field__pwd-toggle:focus-visible {
    outline: 2px solid var(--hms-primary);
    outline-offset: 2px;
    border-radius: 5px;
}
.aes-field__error {
    font-size: 0.76rem;
    color: #dc2626;
    margin-top: 0.3rem;
    display: block;
}

/* Remember me */
.aes-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 1.15rem;
}
.aes-remember input[type=checkbox] {
    width: 1rem; height: 1rem;
    accent-color: var(--hms-primary);
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}
.aes-remember__label {
    font-size: 0.82rem;
    color: #475569;
    cursor: pointer;
    margin: 0;
    user-select: none;
    line-height: 1;
}

/* ── Submit button ── */
.aes-btn {
    display: block;
    width: 100%;
    min-height: 2.875rem;
    border-radius: 8px;
    border: none;
    font-weight: 700;
    font-size: 0.9375rem;
    color: #fff;
    cursor: pointer;
    background: var(--hms-primary);
    letter-spacing: 0.01em;
    line-height: 1;
    transition: filter 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--hms-primary) 35%, transparent);
    margin-top: 0.25rem;
}
.aes-btn:hover { filter: brightness(1.1); }
.aes-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--hms-primary);
}
.aes-btn:active { filter: brightness(0.96); }

/* ── Text link (in-card) ── */
.aes-link {
    color: var(--hms-primary);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}
.aes-link:hover { color: var(--hms-primary-dark); text-decoration: underline; }

/* ── LEGACY compat: keep old classes working for demo mode ── */
.auth-app-shell .auth-btn-primary {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 3rem;
    border-radius: 0.75rem;
    border: none;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    color: #fff;
    cursor: pointer;
    background: var(--hms-primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}
@media (min-width: 768px) { .auth-app-shell .auth-btn-primary { font-size: 1rem; } }
.auth-app-shell .auth-btn-primary:hover { filter: brightness(1.08); }
.auth-app-shell .auth-btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--hms-primary) 55%, transparent);
}
.auth-app-shell .auth-text-gradient {
    background: linear-gradient(135deg, var(--hms-primary-dark), var(--hms-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.auth-app-shell .auth-text-gradient:hover {
    color: var(--hms-primary);
    -webkit-text-fill-color: var(--hms-primary);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    text-decoration: underline;
}
.auth-app-shell .auth-login-form-col .tw-dw-form-control {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
}
.auth-app-shell #login-form .auth-login-field-input {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    -webkit-appearance: none;
    appearance: none;
}
.auth-app-shell .auth-login-password-field { position: relative; width: 100%; }
.auth-app-shell .auth-login-password-input { padding-right: 2.75rem; box-sizing: border-box; }
.auth-app-shell .auth-login-toggle-password {
    position: absolute;
    right: 0.25rem; top: 50%;
    transform: translateY(-50%);
    margin: 0; padding: 0.25rem;
    border: none; background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 0;
    -webkit-tap-highlight-color: transparent;
}
.auth-app-shell .auth-login-toggle-password:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--hms-primary) 60%, #000);
    outline-offset: 2px; border-radius: 6px;
}

/* ── Register wizard (jQuery Steps inside aes-headed-card) ── */
.auth-app-shell .aes-headed-card__body .wizard > .steps .number {
    background: var(--hms-primary);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem; height: 1.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.4rem;
}
.auth-app-shell .aes-headed-card__body .wizard > .steps a {
    color: #374151;
    font-weight: 600;
    font-size: 0.875rem;
}
.auth-app-shell .aes-headed-card__body .wizard > .steps .current a,
.auth-app-shell .aes-headed-card__body .wizard > .steps .current a:hover {
    color: var(--hms-primary);
    background: color-mix(in srgb, var(--hms-primary) 8%, transparent);
    border-radius: 0.4rem;
}
.auth-app-shell .aes-headed-card__body .wizard > .steps .done a { color: #9ca3af; }
.auth-app-shell .aes-headed-card__body .wizard > .content {
    border: none;
    min-height: 280px;
}
.auth-app-shell .aes-headed-card__body .wizard > .actions { padding-top: 0.75rem; }
.auth-app-shell .aes-headed-card__body .wizard > .actions a {
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}
.auth-app-shell .aes-headed-card__body .input-group-addon {
    background: color-mix(in srgb, var(--hms-primary) 8%, #f8fafc);
    border-color: color-mix(in srgb, var(--hms-primary) 20%, #dee2e6);
    color: var(--hms-primary-dark);
}
.auth-app-shell .aes-headed-card__body legend {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--hms-primary-dark);
    border-bottom: 1px solid color-mix(in srgb, var(--hms-primary) 15%, #e2e8f0);
    padding-bottom: 0.4rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
}
