/* ================================================================
   WORKGURU — Modern Auth Pages
   Uses design tokens from wg-theme.css / wg-components.css
   Supports light + dark mode via [data-mode]
   ================================================================ */

/* ── Reset Metronic overrides that leak into auth pages ── */
body.wg-auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--bg-page, #f2f3f8);
}

body.wg-auth-body .m-grid,
body.wg-auth-body .m-page,
body.wg-auth-body .m-login,
body.wg-auth-body .m-stack {
    display: contents;
}

/* ── Page wrapper ── */
.wg-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
        var(--bg-page, #f2f3f8);
}

[data-mode="dark"] .wg-auth-page {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        var(--bg-page, #111320);
}

/* ── Card ── */
.wg-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-default, rgba(226, 232, 240, 0.9));
    border-radius: 24px;
    padding: 40px 36px 36px;
    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.04),
        0 8px 32px rgba(15, 23, 42, 0.06);
}

[data-mode="dark"] .wg-auth-card {
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── Logo ── */
.wg-auth-logo {
    text-align: center;
    margin-bottom: 8px;
}

.wg-auth-logo a {
    display: inline-block;
}

.wg-auth-logo img {
    max-height: 56px;
    width: auto;
}

/* ── Tenant change ── */
.wg-auth-tenant {
    text-align: center;
    padding: 12px 0;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}

/* ── Page titles ── */
.wg-auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading, #1e293b);
    text-align: center;
    margin: 0 0 6px;
    line-height: 1.2;
}

.wg-auth-subtitle {
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* ── Form groups ── */
.wg-auth-form .wg-field {
    margin-bottom: 18px;
}

.wg-auth-form .wg-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #374151);
    margin-bottom: 6px;
}

.wg-auth-form .wg-field .form-control,
.wg-auth-form .form-group .form-control,
.wg-auth-card .m-login__form .form-control {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-heading, #1e293b);
    background: var(--bg-subtle, #f8fafc);
    border: 1.5px solid var(--border-default, #e2e8f0);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.wg-auth-form .wg-field .form-control:focus,
.wg-auth-form .form-group .form-control:focus,
.wg-auth-card .m-login__form .form-control:focus {
    border-color: var(--color-primary, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
    background: var(--bg-surface, #fff);
}

.wg-auth-form .wg-field .form-control::placeholder,
.wg-auth-card .m-login__form .form-control::placeholder {
    color: var(--text-muted, #9ca3af);
}

/* ── Checkbox row (remember me + forgot password) ── */
.wg-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
}

.wg-auth-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary, #4b5563);
}

.wg-auth-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary, #7c3aed);
    cursor: pointer;
    margin: 0;
}

.wg-auth-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-primary, #7c3aed);
    text-decoration: none;
    transition: opacity 0.15s;
}

.wg-auth-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ── Buttons ── */
.wg-auth-btn {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-inverse, #ffffff);
    background: var(--color-primary, #7c3aed);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.wg-auth-btn:hover {
    background: var(--color-primary-hover, #6d28d9);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.wg-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.2);
}

.wg-auth-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary, #4b5563);
    background: transparent;
    border: 1.5px solid var(--border-default, #e2e8f0);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.wg-auth-btn-outline:hover {
    background: var(--bg-subtle, #f8fafc);
    border-color: var(--border-heavy, #cbd5e1);
    color: var(--text-heading, #1e293b);
    text-decoration: none;
}

/* Button row (back + submit side by side) */
.wg-auth-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.wg-auth-actions .wg-auth-btn {
    flex: 1;
}

.wg-auth-actions .wg-auth-btn-outline {
    flex: 0 0 auto;
}

/* ── Divider ── */
.wg-auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted, #9ca3af);
    font-size: 13px;
}

.wg-auth-divider::before,
.wg-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border-default, #e2e8f0);
}

/* ── Social / External login ── */
.wg-auth-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wg-auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary, #4b5563);
    background: var(--bg-subtle, #f8fafc);
    border: 1.5px solid var(--border-default, #e2e8f0);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}

.wg-auth-social-btn:hover {
    background: var(--bg-surface, #fff);
    border-color: var(--border-heavy, #cbd5e1);
}

/* ── Xero SSO button styling ── */
.wg-auth-card [data-xero-sso] {
    margin-top: 16px;
}

/* ── Alert messages ── */
.wg-auth-card .alert {
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    border: none;
}

.wg-auth-card .alert-success {
    background: var(--color-success-light, #d1fae5);
    color: var(--color-success, #059669);
}

.wg-auth-card .alert-danger {
    background: var(--color-danger-light, #fee2e2);
    color: var(--color-danger, #dc2626);
}

.wg-auth-card .alert-warning {
    background: var(--color-warning-light, #fef3c7);
    color: var(--color-warning, #d97706);
}

/* ── Info text / descriptions ── */
.wg-auth-info {
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ── Result list (RegisterResult) ── */
.wg-auth-result-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.wg-auth-result-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-default, #e2e8f0);
    font-size: 14px;
    color: var(--text-primary, #374151);
    display: flex;
    gap: 8px;
}

.wg-auth-result-list li:last-child {
    border-bottom: none;
}

.wg-auth-result-list .wg-label {
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    min-width: 110px;
    flex-shrink: 0;
}

/* ── Footer ── */
.wg-auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
}

/* ── Metronic class overrides for compatibility ── */

/* Override old m-login styles */
.wg-auth-card .m-login__signin,
.wg-auth-card .m-login__head,
.wg-auth-card .m-login__form,
.wg-auth-card .m-form {
    padding: 0;
    margin: 0;
}

.wg-auth-card .m-login__title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading, #1e293b);
    text-align: center;
    margin: 0 0 24px;
    line-height: 1.2;
}

.wg-auth-card .m-login__form-sub {
    margin-bottom: 24px;
}

.wg-auth-card .m-login__form-action {
    display: flex;
    gap: 12px;
    padding: 0;
    margin: 0;
}

/* Override Metronic form-group spacing */
.wg-auth-card .form-group.m-form__group {
    margin-bottom: 18px;
}

/* Override old button styles */
.wg-auth-card .btn-focus,
.wg-auth-card .btn.btn-focus {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-inverse, #ffffff) !important;
    background: var(--color-primary, #7c3aed) !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.wg-auth-card .btn-focus:hover {
    background: var(--color-primary-hover, #6d28d9) !important;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.wg-auth-card .btn-outline-focus,
.wg-auth-card .btn.btn-outline-focus {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-secondary, #4b5563) !important;
    background: transparent !important;
    border: 1.5px solid var(--border-default, #e2e8f0) !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.wg-auth-card .btn-outline-focus:hover {
    background: var(--bg-subtle, #f8fafc) !important;
    border-color: var(--border-heavy, #cbd5e1) !important;
    color: var(--text-heading, #1e293b) !important;
}

/* Override Metronic checkbox styles */
.wg-auth-card .m-checkbox {
    font-size: 14px;
    color: var(--text-secondary, #4b5563);
}

.wg-auth-card .m-checkbox > span {
    border-color: var(--border-default, #e2e8f0);
    border-radius: 4px;
}

.wg-auth-card .m-checkbox > input:checked ~ span {
    background-color: var(--color-primary, #7c3aed);
    border-color: var(--color-primary, #7c3aed);
}

/* Override Metronic link styles */
.wg-auth-card .m-link,
.wg-auth-card .m-link--focus {
    color: var(--color-primary, #7c3aed);
    font-weight: 500;
}

.wg-auth-card .m-link:hover {
    opacity: 0.8;
}

/* ── Login-options (external providers) ── */
.wg-auth-card .login-options {
    margin: 0;
    overflow: visible;
}

.wg-auth-card .login-options h4 {
    float: none;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted, #9ca3af) !important;
    margin: 0 0 12px;
}

.wg-auth-card .login-options .social-icons {
    float: none;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
}

.wg-auth-card .social-icons li {
    float: none;
    text-indent: 0;
    margin: 0;
}

/* ── Select dropdown (SendSecurityCode) ── */
.wg-auth-card select.form-control {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .wg-auth-page {
        padding: 24px 16px;
    }

    .wg-auth-card {
        padding: 28px 24px 24px;
        border-radius: 20px;
    }

    .wg-auth-card .m-login__form-action {
        flex-direction: column-reverse;
    }

    .wg-auth-card .btn-outline-focus {
        width: 100%;
    }
}

/* ================================================================
   DARK MODE — Explicit overrides for Account pages
   ================================================================ */

/* Form inputs need !important to beat Metronic and browser autofill */
[data-mode="dark"] .wg-auth-card .form-control,
[data-mode="dark"] .wg-auth-form .wg-field .form-control,
[data-mode="dark"] .wg-auth-form .form-group .form-control {
    background: var(--bg-subtle, #22252f) !important;
    border-color: var(--border-default, #3f4452) !important;
    color: var(--text-heading, #e2e4ea) !important;
}

[data-mode="dark"] .wg-auth-card .form-control:focus,
[data-mode="dark"] .wg-auth-form .wg-field .form-control:focus {
    background: var(--bg-surface, #1a1d27) !important;
    border-color: var(--color-primary, #5867dd) !important;
    box-shadow: 0 0 0 3px rgba(88, 103, 221, 0.2) !important;
}

[data-mode="dark"] .wg-auth-card .form-control::placeholder {
    color: var(--text-muted, #6b7280) !important;
}

/* Autofill override for dark mode */
[data-mode="dark"] .wg-auth-card .form-control:-webkit-autofill,
[data-mode="dark"] .wg-auth-card .form-control:-webkit-autofill:hover,
[data-mode="dark"] .wg-auth-card .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-heading, #e2e4ea) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--bg-subtle, #22252f) inset !important;
    box-shadow: 0 0 0 1000px var(--bg-subtle, #22252f) inset !important;
    border-color: var(--border-default, #3f4452) !important;
}

/* Labels */
[data-mode="dark"] .wg-auth-form .wg-field label {
    color: var(--text-secondary, #b0b4bc) !important;
}

/* Checkbox */
[data-mode="dark"] .wg-auth-checkbox {
    color: var(--text-secondary, #b0b4bc);
}

/* Button shadow adjustments */
[data-mode="dark"] .wg-auth-btn {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-mode="dark"] .wg-auth-btn:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-mode="dark"] .wg-auth-card .btn-focus {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Outline button in dark mode */
[data-mode="dark"] .wg-auth-btn-outline,
[data-mode="dark"] .wg-auth-card .btn-outline-focus {
    color: var(--text-secondary, #b0b4bc) !important;
    border-color: var(--border-default, #3f4452) !important;
}

[data-mode="dark"] .wg-auth-btn-outline:hover,
[data-mode="dark"] .wg-auth-card .btn-outline-focus:hover {
    background: var(--bg-subtle, #22252f) !important;
    color: var(--text-heading, #e2e4ea) !important;
}

/* Xero SSO button dark mode — the iframe is external, just add margin */
[data-mode="dark"] .wg-auth-card [data-xero-sso] {
    filter: brightness(0.9);
}

/* ================================================================
   SweetAlert — Themed overrides for auth pages
   The non-minified account-layout-libs.css is missing the
   SweetAlert stylesheet, so we provide the essential rules here,
   styled to match the WorkGuru auth card design.
   ================================================================ */

.sweet-overlay {
    background-color: rgba(0, 0, 0, 0.4);
    position: fixed;
    left: 0; right: 0; top: 0; bottom: 0;
    display: none;
    z-index: 10000;
}

.sweet-alert {
    background: var(--bg-surface, #ffffff);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    width: 420px;
    max-width: calc(100vw - 40px);
    padding: 32px 28px 24px;
    border-radius: 20px;
    text-align: center;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    overflow: hidden;
    display: none;
    z-index: 99999;
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.12),
        0 1px 3px rgba(15, 23, 42, 0.06);
    border: 1px solid var(--border-default, rgba(226, 232, 240, 0.9));
}

.sweet-alert h2 {
    color: var(--text-heading, #1e293b);
    font-size: 22px;
    font-weight: 700;
    text-transform: none;
    margin: 20px 0 8px;
    padding: 0;
    line-height: 1.3;
}

.sweet-alert p {
    color: var(--text-secondary, #4b5563);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

.sweet-alert fieldset {
    border: none;
    position: relative;
}

.sweet-alert .sa-error-container {
    background: var(--color-danger-light, #fee2e2);
    margin: 12px -28px 0;
    overflow: hidden;
    padding: 0 28px;
    max-height: 0;
    transition: padding 0.2s, max-height 0.25s;
}

.sweet-alert .sa-error-container.show {
    padding: 12px 28px;
    max-height: 100px;
}

.sweet-alert .sa-error-container .icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--color-danger, #dc2626);
    color: #fff;
    line-height: 24px;
    text-align: center;
    margin-right: 6px;
    font-size: 14px;
    font-weight: 700;
}

.sweet-alert .sa-error-container p {
    display: inline-block;
    color: var(--color-danger, #dc2626);
    font-size: 14px;
}

.sweet-alert button {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    padding: 10px 28px;
    margin: 20px 5px 0;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.sweet-alert button.confirm {
    background: var(--color-primary, #7c3aed);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}

.sweet-alert button.confirm:hover {
    background: var(--color-primary-hover, #6d28d9);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}

.sweet-alert button.confirm:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

.sweet-alert button.cancel {
    background: var(--bg-subtle, #f1f5f9);
    color: var(--text-secondary, #4b5563);
}

.sweet-alert button.cancel:hover {
    background: var(--border-default, #e2e8f0);
}

.sweet-alert button.cancel:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* SA icon animations */
.sweet-alert .sa-icon {
    width: 80px;
    height: 80px;
    border-width: 4px;
    border-style: solid;
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    box-sizing: content-box;
}

.sweet-alert .sa-icon.sa-error {
    border-color: var(--color-danger, #dc2626);
}

.sweet-alert .sa-icon.sa-error .sa-x-mark {
    position: relative;
    display: block;
}

.sweet-alert .sa-icon.sa-error .sa-line {
    position: absolute;
    height: 5px;
    width: 47px;
    background-color: var(--color-danger, #dc2626);
    display: block;
    top: 37px;
    border-radius: 2px;
}

.sweet-alert .sa-icon.sa-error .sa-line.sa-left {
    transform: rotate(45deg);
    left: 17px;
}

.sweet-alert .sa-icon.sa-error .sa-line.sa-right {
    transform: rotate(-45deg);
    right: 16px;
}

.sweet-alert .sa-icon.sa-warning {
    border-color: #f8bb86;
}

.sweet-alert .sa-icon.sa-warning .sa-body {
    position: absolute;
    width: 5px;
    height: 47px;
    left: 50%;
    top: 10px;
    margin-left: -2px;
    border-radius: 2px;
    background-color: #f8bb86;
}

.sweet-alert .sa-icon.sa-warning .sa-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-left: -3px;
    left: 50%;
    bottom: 10px;
    background-color: #f8bb86;
}

.sweet-alert .sa-icon.sa-success {
    border-color: var(--color-success, #059669);
}

.sweet-alert .sa-icon.sa-success .sa-line {
    height: 5px;
    background-color: var(--color-success, #059669);
    display: block;
    border-radius: 2px;
    position: absolute;
    z-index: 2;
}

.sweet-alert .sa-icon.sa-success .sa-line.sa-tip {
    width: 25px;
    left: 14px;
    top: 46px;
    transform: rotate(45deg);
}

.sweet-alert .sa-icon.sa-success .sa-line.sa-long {
    width: 47px;
    right: 8px;
    top: 38px;
    transform: rotate(-45deg);
}

.sweet-alert .sa-icon.sa-success .sa-placeholder {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(5, 150, 105, 0.2);
    border-radius: 50%;
    box-sizing: content-box;
    position: absolute;
    left: -4px;
    top: -4px;
    z-index: 2;
}

.sweet-alert .sa-icon.sa-info {
    border-color: #3fc3ee;
}

.sweet-alert .sa-icon.sa-info::before {
    content: "";
    position: absolute;
    width: 5px;
    height: 29px;
    left: 50%;
    margin-left: -2px;
    bottom: 17px;
    border-radius: 2px;
    background-color: #3fc3ee;
}

.sweet-alert .sa-icon.sa-info::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-left: -3px;
    left: 50%;
    top: 19px;
    background-color: #3fc3ee;
}

/* SA button container & loading */
.sweet-alert .sa-confirm-button-container {
    display: inline-block;
    position: relative;
}

.sweet-alert .la-ball-fall {
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: -27px;
    margin-top: 4px;
    opacity: 0;
    visibility: hidden;
}

.sweet-alert input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    border: 1.5px solid var(--border-default, #e2e8f0);
    height: 44px;
    margin-top: 10px;
    margin-bottom: 12px;
    font-size: 15px;
    font-family: inherit;
    padding: 0 14px;
    display: none;
    background: var(--bg-subtle, #f8fafc);
    color: var(--text-heading, #1e293b);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sweet-alert input:focus {
    outline: none;
    border-color: var(--color-primary, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.sweet-alert.show-input input {
    display: block;
}

/* Dark mode overrides */
[data-mode="dark"] .sweet-alert {
    background: var(--bg-surface, #1a1d27);
    border-color: var(--border-default, #3f4452);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-mode="dark"] .sweet-alert h2 {
    color: var(--text-heading, #e2e4ea);
}

[data-mode="dark"] .sweet-alert p {
    color: var(--text-secondary, #b0b4bc);
}

[data-mode="dark"] .sweet-alert button.cancel {
    background: var(--bg-subtle, #22252f);
    color: var(--text-secondary, #b0b4bc);
}

[data-mode="dark"] .sweet-alert button.cancel:hover {
    background: var(--border-default, #3f4452);
}

[data-mode="dark"] .sweet-alert .sa-error-container {
    background: rgba(220, 38, 38, 0.15);
}

[data-mode="dark"] .sweet-alert input {
    background: var(--bg-subtle, #22252f);
    border-color: var(--border-default, #3f4452);
    color: var(--text-heading, #e2e4ea);
}

/* Visibility helpers used by SweetAlert JS */
.sweet-alert.visible {
    display: block;
}

.sweet-overlay.visible {
    display: block;
}
