:root {
    --ha-primary: #1769e0;
    --ha-primary-hover: #0d57c7;
    --ha-ink: #102044;
    --ha-text: #334155;
    --ha-muted: #64748b;
    --ha-canvas: #f4f7fb;
    --ha-line: #dfe6ef;
    --ha-danger: #bd3545;
}

html,
body.harmony-auth-body {
    min-height: 100%;
    color: var(--ha-text);
    background:
        radial-gradient(circle at 14% 10%, rgba(23, 105, 224, .09), transparent 26rem),
        radial-gradient(circle at 90% 100%, rgba(14, 165, 233, .07), transparent 24rem),
        var(--ha-canvas) !important;
    font-family: 'Vazirmatn', 'IRANSans', 'Segoe UI', sans-serif !important;
}

.harmony-auth-body *,
.harmony-auth-body *::before,
.harmony-auth-body *::after {
    box-sizing: border-box;
}

.harmony-auth-body :focus-visible {
    outline: 3px solid rgba(23, 105, 224, .22) !important;
    outline-offset: 2px;
}

.harmony-auth-body #auth-app {
    padding: 1rem !important;
}

.harmony-auth-body #auth-app > div:first-child > .absolute {
    opacity: .42;
}

.harmony-auth-body .auth-shell {
    max-width: 64rem !important;
    min-height: 36rem;
    border: 1px solid var(--ha-line) !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 28px 80px -42px rgba(16, 32, 68, .38) !important;
}

.harmony-auth-body .harmony-story {
    min-height: 36rem !important;
    padding: 2rem !important;
    background: linear-gradient(145deg, #1e6dde 0%, #1556c5 72%, #1045a5 100%) !important;
}

.harmony-auth-body .harmony-story .harmony-logo {
    width: 3.25rem !important;
    height: 3.25rem !important;
    border-radius: 12px !important;
}

.harmony-auth-body .harmony-story .harmony-logo svg {
    width: 2.25rem !important;
    height: 2.25rem !important;
}

.harmony-auth-body .harmony-story .mt-16 {
    margin-top: 3.25rem !important;
}

.harmony-auth-body .harmony-story h1 {
    margin-top: .75rem !important;
    font-size: 2rem !important;
    line-height: 1.6 !important;
}

.harmony-auth-body .harmony-story h1 + p {
    margin-top: .75rem !important;
    font-size: .82rem !important;
    line-height: 2 !important;
}

.harmony-auth-body .harmony-story > div:last-child {
    gap: .55rem !important;
}

.harmony-auth-body .harmony-story > div:last-child > div {
    padding: .75rem !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, .09) !important;
}

.harmony-auth-body .harmony-story > div:last-child p {
    margin-top: .4rem !important;
    font-size: .68rem !important;
}

.harmony-auth-body .auth-form-panel {
    padding: 1.2rem !important;
    background: #fff !important;
}

.harmony-auth-body .auth-form-panel > div {
    max-width: 26rem !important;
}

.harmony-auth-body .glass-card {
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.harmony-auth-body .glass-card::before {
    display: none !important;
}

.harmony-auth-body .auth-card-content {
    max-height: none !important;
    padding: .6rem !important;
    overflow: visible !important;
}

.harmony-auth-body .auth-brand {
    margin-bottom: .9rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid #edf0f5;
}

.harmony-auth-body .auth-brand .harmony-logo {
    width: 2.65rem !important;
    height: 2.65rem !important;
    border: 1px solid #d9e7f9;
    border-radius: 10px !important;
    background: #f4f8fe !important;
    box-shadow: none !important;
}

.harmony-auth-body .auth-brand .harmony-logo svg {
    width: 2rem !important;
    height: 2rem !important;
}

.harmony-auth-body .auth-brand-kicker {
    color: var(--ha-primary) !important;
    font-size: .63rem !important;
    font-weight: 850 !important;
}

.harmony-auth-body .auth-brand-title {
    color: var(--ha-ink) !important;
    font-size: 1.05rem !important;
    font-weight: 900 !important;
}

.harmony-auth-body .auth-brand-copy,
.harmony-auth-body .auth-welcome p {
    color: var(--ha-muted) !important;
    font-size: .67rem !important;
}

.harmony-auth-body .auth-welcome h2,
.harmony-auth-body .auth-welcome h1 {
    color: var(--ha-ink) !important;
    font-size: 1.15rem !important;
    line-height: 1.6 !important;
    font-weight: 900 !important;
}

.harmony-auth-body .glass-card .text-white,
.harmony-auth-body .glass-card .text-white\/80,
.harmony-auth-body .glass-card .text-white\/70,
.harmony-auth-body .glass-card .text-white\/60,
.harmony-auth-body .glass-card .text-white\/50 {
    color: var(--ha-text) !important;
}

.harmony-auth-body .glass-card [class*="text-primary-2"],
.harmony-auth-body .glass-card [class*="text-primary-1"] {
    color: var(--ha-primary) !important;
}

.harmony-auth-body [role="tablist"],
.harmony-auth-body .identifier-switch,
.harmony-auth-body [data-login-panel="otp"] > form > div > .grid.grid-cols-2 {
    padding: .24rem !important;
    border: 1px solid var(--ha-line) !important;
    border-radius: 10px !important;
    background: #f3f6fa !important;
    box-shadow: none !important;
}

.harmony-auth-body .tab-trigger,
.harmony-auth-body .identifier-trigger,
.harmony-auth-body .otp-trigger {
    min-height: 36px;
    padding: .4rem .6rem !important;
    border-radius: 8px !important;
    color: var(--ha-muted) !important;
    background: transparent !important;
    font-size: .68rem !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

.harmony-auth-body .tab-trigger[aria-selected="true"],
.harmony-auth-body .identifier-trigger.bg-white,
.harmony-auth-body .otp-pill-active,
.harmony-auth-body .otp-trigger.bg-white {
    color: var(--ha-primary) !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(16, 32, 68, .08) !important;
}

.harmony-auth-body .auth-field-head,
.harmony-auth-body .glass-card label {
    color: #46556c !important;
    font-size: .68rem !important;
    font-weight: 800 !important;
}

.harmony-auth-body .glass-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.harmony-auth-body .glass-card select,
.harmony-auth-body .glass-card textarea {
    width: 100%;
    min-height: 42px;
    padding: .52rem .75rem !important;
    padding-left: 2.5rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 9px !important;
    color: var(--ha-ink) !important;
    background: #fff !important;
    font-size: .78rem !important;
    box-shadow: none !important;
}

.harmony-auth-body .glass-card input::placeholder,
.harmony-auth-body .glass-card textarea::placeholder {
    color: #9aa5b5 !important;
}

.harmony-auth-body .glass-card input:focus,
.harmony-auth-body .glass-card select:focus,
.harmony-auth-body .glass-card textarea:focus {
    outline: 0 !important;
    border-color: #71a5eb !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(23, 105, 224, .11) !important;
}

.harmony-auth-body .auth-input-icon {
    color: #7b8799 !important;
}

.harmony-auth-body .remember-label {
    padding: .1rem 0;
    color: var(--ha-muted) !important;
}

.harmony-auth-body .remember-track {
    background: #d6dee9 !important;
}

.harmony-auth-body .peer:checked + .remember-track {
    background: var(--ha-primary) !important;
}

.harmony-auth-body .cta-button,
.harmony-auth-body .otp-submit,
.harmony-auth-body .otp-verify,
.harmony-auth-body .glass-card button[type="submit"] {
    min-height: 42px;
    padding: .55rem .85rem !important;
    border: 0 !important;
    border-radius: 9px !important;
    color: #fff !important;
    background: var(--ha-primary) !important;
    font-size: .75rem !important;
    font-weight: 850 !important;
    box-shadow: 0 8px 20px rgba(23, 105, 224, .18) !important;
}

.harmony-auth-body .cta-button:hover,
.harmony-auth-body .otp-submit:hover,
.harmony-auth-body .otp-verify:hover,
.harmony-auth-body .glass-card button[type="submit"]:hover {
    background: var(--ha-primary-hover) !important;
    transform: none !important;
}

.harmony-auth-body .glass-card .bg-rose-900\/40,
.harmony-auth-body .glass-card [class*="bg-rose"] {
    color: #a62e3c !important;
    border-color: #efc4ca !important;
    background: #fff4f5 !important;
}

.harmony-auth-body .auth-error-summary {
    margin-top: .75rem !important;
    padding: .65rem .8rem !important;
    border-radius: 10px !important;
}

.harmony-auth-body .glass-card .bg-emerald-900\/40,
.harmony-auth-body .glass-card [class*="bg-emerald-900"] {
    color: #087055 !important;
    border-color: #bee5d7 !important;
    background: #effaf6 !important;
}

.harmony-auth-body [data-forgot-modal],
.harmony-auth-body [data-reset-modal] {
    background: rgba(15, 23, 42, .45) !important;
    backdrop-filter: blur(4px);
}

.harmony-auth-body [data-forgot-modal] > div,
.harmony-auth-body [data-reset-modal] > div {
    border: 1px solid var(--ha-line) !important;
    border-radius: 14px !important;
    color: var(--ha-text) !important;
    background: #fff !important;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22) !important;
}

/* Reset-password screen shares the same compact public surface. */
.harmony-auth-body > div.relative.isolate.min-h-screen {
    min-height: 100vh !important;
    min-height: 100dvh !important;
    background: transparent !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen > .relative.z-10 {
    min-height: 100vh !important;
    min-height: 100dvh !important;
    padding: 1rem !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen .max-w-3xl {
    max-width: 34rem !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen .rounded-\[32px\] {
    border: 1px solid var(--ha-line) !important;
    border-radius: 16px !important;
    color: var(--ha-text) !important;
    background: #fff !important;
    box-shadow: 0 24px 70px -36px rgba(16, 32, 68, .36) !important;
    backdrop-filter: none !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen .rounded-\[32px\] > .relative {
    padding: 1.1rem !important;
    gap: 1rem !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen h1,
.harmony-auth-body > div.relative.isolate.min-h-screen .text-white {
    color: var(--ha-ink) !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen .text-white\/70,
.harmony-auth-body > div.relative.isolate.min-h-screen .text-white\/60 {
    color: var(--ha-muted) !important;
}

.harmony-auth-body > div.relative.isolate.min-h-screen input {
    min-height: 42px;
    border: 1px solid #cbd5e1 !important;
    border-radius: 9px !important;
    color: var(--ha-ink) !important;
    background: #fff !important;
}

@media (max-width: 1023px) {
    .harmony-auth-body .auth-shell {
        max-width: 29rem !important;
        min-height: 0;
        border-radius: 16px !important;
    }

    .harmony-auth-body .auth-form-panel {
        padding: 1rem !important;
    }
}

@media (min-width: 1024px) and (max-height: 760px) {
    .harmony-auth-body #auth-app {
        padding: .5rem !important;
    }

    .harmony-auth-body .auth-shell,
    .harmony-auth-body .harmony-story {
        min-height: calc(100dvh - 1rem) !important;
    }

    .harmony-auth-body .harmony-story {
        padding: 1.35rem !important;
    }

    .harmony-auth-body .harmony-story .mt-16 {
        margin-top: 1.45rem !important;
    }

    .harmony-auth-body .harmony-story h1 {
        margin-top: .45rem !important;
        font-size: 1.65rem !important;
        line-height: 1.55 !important;
    }

    .harmony-auth-body .harmony-story h1 + p {
        margin-top: .45rem !important;
        line-height: 1.8 !important;
    }

    .harmony-auth-body .auth-form-panel {
        padding: .75rem 1rem !important;
    }

    .harmony-auth-body .auth-card-content {
        padding: .35rem !important;
    }

    .harmony-auth-body .auth-card-content .space-y-5 > :not([hidden]) ~ :not([hidden]),
    .harmony-auth-body .auth-card-content .space-y-4 > :not([hidden]) ~ :not([hidden]) {
        margin-top: .7rem !important;
    }

    .harmony-auth-body .auth-card-content > .mt-5 {
        margin-top: .7rem !important;
    }

    .harmony-auth-body #login-form > :not([hidden]) ~ :not([hidden]) {
        margin-top: .75rem !important;
    }

    .harmony-auth-body #login-form .space-y-3 > :not([hidden]) ~ :not([hidden]) {
        margin-top: .45rem !important;
    }

    .harmony-auth-body .auth-brand {
        margin-bottom: .55rem;
        padding-bottom: .55rem;
    }
}

@media (max-width: 640px) {
    .harmony-auth-body #auth-app {
        align-items: flex-start !important;
        padding: .55rem !important;
    }

    .harmony-auth-body .auth-shell {
        width: 100%;
        border-radius: 13px !important;
    }

    .harmony-auth-body .auth-form-panel {
        padding: .55rem !important;
    }

    .harmony-auth-body .auth-card-content {
        padding: .55rem !important;
    }

    .harmony-auth-body .glass-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .harmony-auth-body .glass-card select,
    .harmony-auth-body .glass-card textarea {
        min-height: 44px;
        font-size: 16px !important;
    }

    .harmony-auth-body .cta-button,
    .harmony-auth-body .otp-submit,
    .harmony-auth-body .otp-verify,
    .harmony-auth-body .glass-card button[type="submit"] {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .harmony-auth-body *,
    .harmony-auth-body *::before,
    .harmony-auth-body *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Product UI 2026 — public and authentication surfaces */
html,
body.harmony-auth-body {
    background: #f8fafc !important;
}

.harmony-auth-body #auth-app {
    padding: 24px !important;
    background: #f8fafc !important;
}

.harmony-auth-body #auth-app > .absolute {
    display: none !important;
}

.harmony-auth-body .auth-shell {
    width: min(100%, 980px) !important;
    min-height: 610px !important;
    border: 1px solid #dfe6ef !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: 0 24px 65px -42px rgba(15, 32, 68, .32) !important;
}

.harmony-auth-body .harmony-story {
    min-height: 610px !important;
    padding: 38px !important;
    border-left: 1px solid #064fc1;
    color: #fff;
    background: #075fe4 !important;
}

.harmony-auth-body .harmony-story > .absolute {
    display: none !important;
}

.harmony-auth-body .harmony-story .harmony-logo,
.harmony-auth-body .auth-brand .harmony-logo {
    display: grid !important;
    place-items: center;
    border: 1px solid #d9e6fa !important;
    border-radius: 11px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.harmony-auth-body .harmony-story .harmony-logo img {
    width: 42px;
    height: 42px;
}

.harmony-auth-body .auth-brand .harmony-logo img {
    width: 34px;
    height: 34px;
}

.harmony-auth-body .harmony-story .mt-16 {
    margin-top: 54px !important;
}

.harmony-auth-body .harmony-story h1 {
    max-width: 420px;
    margin-top: 12px !important;
    font-size: 2.25rem !important;
    line-height: 1.65 !important;
}

.harmony-auth-body .harmony-story h1 + p {
    max-width: 430px;
    margin-top: 12px !important;
    color: rgba(255, 255, 255, .82) !important;
    font-size: .84rem !important;
    line-height: 2 !important;
}

.harmony-auth-body .harmony-story > div:last-child {
    gap: 0 !important;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 11px;
    overflow: hidden;
}

.harmony-auth-body .harmony-story > div:last-child > div {
    padding: 13px !important;
    border: 0 !important;
    border-left: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
}

.harmony-auth-body .harmony-story > div:last-child > div:last-child {
    border-left: 0 !important;
}

.harmony-auth-body .auth-form-panel {
    padding: 32px 38px !important;
    background: #fff !important;
}

.harmony-auth-body .auth-form-panel > div {
    max-width: 390px !important;
}

.harmony-auth-body .glass-card,
.harmony-auth-body .auth-card-content {
    background: transparent !important;
    box-shadow: none !important;
}

.harmony-auth-body .auth-card-content {
    padding: 0 !important;
}

.harmony-auth-body .auth-brand {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-color: #e7ecf3;
}

.harmony-auth-body .auth-brand-title {
    font-size: 1.12rem !important;
}

.harmony-auth-body .auth-welcome {
    margin-top: 0 !important;
}

.harmony-auth-body .auth-welcome h2 {
    font-size: 1.45rem !important;
}

.harmony-auth-body .auth-welcome p {
    font-size: .74rem !important;
}

.harmony-auth-body [role="tablist"],
.harmony-auth-body .identifier-switch,
.harmony-auth-body [data-login-panel="otp"] > form > div > .grid.grid-cols-2 {
    padding: 3px !important;
    border-color: #dfe6ef !important;
    border-radius: 9px !important;
    background: #f5f7fa !important;
}

.harmony-auth-body .tab-trigger,
.harmony-auth-body .identifier-trigger,
.harmony-auth-body .otp-trigger {
    min-height: 36px;
    border-radius: 7px !important;
}

.harmony-auth-body .tab-trigger[aria-selected="true"] {
    color: #075fe4 !important;
    background: #fff !important;
    box-shadow: 0 1px 4px rgba(15, 32, 68, .08) !important;
}

.harmony-auth-body .auth-field-head,
.harmony-auth-body .glass-card label {
    font-size: .7rem !important;
}

.harmony-auth-body .glass-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.harmony-auth-body .glass-card select,
.harmony-auth-body .glass-card textarea {
    min-height: 46px !important;
    border-color: #cbd5e1 !important;
    border-radius: 9px !important;
    background: #fff !important;
    font-size: .78rem !important;
}

.harmony-auth-body .cta-button,
.harmony-auth-body .otp-submit,
.harmony-auth-body .otp-verify,
.harmony-auth-body .glass-card button[type="submit"],
.harmony-auth-body #forgot-overlay button[type="submit"] {
    min-height: 46px !important;
    border-radius: 9px !important;
    background: #075fe4 !important;
    box-shadow: none !important;
}

.harmony-auth-body .cta-button::before {
    display: none !important;
}

.harmony-auth-body .cta-button:hover,
.harmony-auth-body .otp-submit:hover,
.harmony-auth-body .otp-verify:hover,
.harmony-auth-body .glass-card button[type="submit"]:hover,
.harmony-auth-body #forgot-overlay button[type="submit"]:hover {
    background: #064fc1 !important;
}

.harmony-auth-body [data-forgot-modal],
.harmony-auth-body [data-reset-modal],
.harmony-auth-body #forgot-overlay {
    background: rgba(15, 32, 68, .38) !important;
    backdrop-filter: blur(2px);
}

.harmony-auth-body [data-forgot-modal] > div,
.harmony-auth-body [data-reset-modal] > div,
.harmony-auth-body #forgot-overlay > div {
    border-color: #dfe6ef !important;
    border-radius: 13px !important;
    background: #fff !important;
    box-shadow: 0 22px 60px rgba(15, 32, 68, .18) !important;
}

@media (max-width: 1023px) {
    .harmony-auth-body #auth-app {
        align-items: center !important;
        padding: 16px !important;
    }

    .harmony-auth-body .auth-shell {
        width: min(100%, 460px) !important;
        min-height: 0 !important;
        border-radius: 14px !important;
    }

    .harmony-auth-body .harmony-story {
        display: none !important;
    }

    .harmony-auth-body .auth-form-panel {
        padding: 24px !important;
    }
}

@media (max-width: 560px) {
    .harmony-auth-body #auth-app {
        align-items: flex-start !important;
        padding: 8px !important;
    }

    .harmony-auth-body .auth-shell {
        width: 100% !important;
        border-radius: 12px !important;
    }

    .harmony-auth-body .auth-form-panel {
        padding: 18px 14px !important;
    }

    .harmony-auth-body .glass-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    .harmony-auth-body .glass-card select,
    .harmony-auth-body .glass-card textarea {
        min-height: 46px !important;
        font-size: 16px !important;
    }
}
