:root {
    --login-bg: #0d1524;
    --login-panel: #131d2d;
    --login-panel-edge: #2d3f5f;
    --login-card-shadow: 0 24px 50px rgba(0, 0, 0, 0.26);
    --login-text: #f4f7fb;
    --login-muted: #a8b8d2;
    --login-input-bg: #101827;
    --login-input-edge: #314765;
    --login-button: #274166;
    --login-button-hover: #2e4b74;
    --login-soft-button: #111a2a;
    --login-soft-button-hover: #162237;
    --login-error-bg: rgba(182, 63, 63, 0.16);
    --login-error-edge: rgba(236, 103, 103, 0.28);
    --login-error-text: #ffb8b8;
}

html.theme-light {
    --login-bg: #edf3f8;
    --login-panel: #ffffff;
    --login-panel-edge: rgba(18, 52, 79, 0.14);
    --login-card-shadow: 0 24px 50px rgba(17, 34, 51, 0.12);
    --login-text: #24333f;
    --login-muted: #60707d;
    --login-input-bg: rgba(255,255,255,0.98);
    --login-input-edge: rgba(18, 52, 79, 0.16);
    --login-button: #12344f;
    --login-button-hover: #1a4465;
    --login-soft-button: #f6f8fa;
    --login-soft-button-hover: #edf3f8;
    --login-error-bg: rgba(182, 63, 63, 0.08);
    --login-error-edge: rgba(182, 63, 63, 0.18);
    --login-error-text: #9b2c2c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    font-family: "Segoe UI", sans-serif;
    color: var(--login-text);
    background:
        radial-gradient(circle at top, rgba(40, 72, 117, 0.16), transparent 28%),
        linear-gradient(180deg, #0d1524 0%, #0b1321 100%);
}

html.theme-light body {
    background:
        radial-gradient(circle at top right, rgba(201, 138, 42, 0.16), transparent 24%),
        radial-gradient(circle at top left, rgba(18, 52, 79, 0.08), transparent 28%),
        linear-gradient(180deg, #edf3f8 0%, #f7f3ec 100%);
}

.panel {
    width: min(100%, 486px);
    max-width: 100%;
    background: linear-gradient(180deg, rgba(20, 30, 46, 0.98), rgba(17, 27, 42, 0.98));
    border: 1px solid var(--login-panel-edge);
    border-radius: 16px;
    padding: 18px 18px 16px;
    box-shadow: var(--login-card-shadow);
    position: relative;
}

html.theme-light .panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 250, 0.96));
}

.panel-badge {
    width: 74px;
    height: 74px;
    margin: -2px auto 18px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(180deg, #101726 0%, #0b1220 100%);
    border: 1px solid rgba(84, 112, 153, 0.4);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 6px 0 rgba(0,0,0,0.45);
}

.panel-badge svg {
    width: 46px;
    height: 46px;
    display: block;
}

.panel-badge .badge-accent {
    fill: url(#solutranscribe-badge-gradient);
}

.panel-badge .badge-line {
    fill: none;
    stroke: #f4f7fb;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.panel-badge .badge-text {
    fill: #ffffff;
    font-size: 4.2px;
    font-weight: 800;
    font-family: "Segoe UI", sans-serif;
    letter-spacing: 0.18em;
}

.eyebrow {
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d8e3f3;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}

h1 {
    margin: 0 0 10px;
    font-size: clamp(34px, 5vw, 46px);
    line-height: 1.04;
    color: #ffffff;
}

.lead {
    margin: 0 0 20px;
    color: var(--login-muted);
    line-height: 1.45;
    font-size: 17px;
}

.error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--login-error-edge);
    background: var(--login-error-bg);
    color: var(--login-error-text);
    font-size: 14px;
}

form {
    display: grid;
    gap: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    border: 1px solid var(--login-input-edge);
    border-radius: 14px;
    padding: 14px 14px;
    font: inherit;
    background: var(--login-input-bg);
    color: var(--login-text);
    margin-bottom: 16px;
    outline: none;
}

input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="text"]::placeholder {
    color: #8192ae;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
    border-color: #5f84bb;
    box-shadow: 0 0 0 3px rgba(95, 132, 187, 0.18);
}

.password-field {
    position: relative;
    margin-bottom: 16px;
}

.password-field input {
    margin-bottom: 0;
    padding-right: 54px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(95, 132, 187, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--login-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(95, 132, 187, 0.28);
    color: var(--login-text);
}

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(95, 132, 187, 0.2);
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -2px 0 18px;
    color: var(--login-muted);
    font-size: 14px;
}

.remember input {
    accent-color: #5c84c3;
}

.button,
.login-actions .install-trigger {
    width: 100%;
    min-height: 40px;
    border-radius: 14px;
    padding: 0 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button {
    border: 1px solid #486792;
    color: #ffffff;
    background: linear-gradient(180deg, #2a456c 0%, #244164 100%);
}

.button:hover {
    background: linear-gradient(180deg, #31517f 0%, #28486f 100%);
    transform: translateY(-1px);
}

.login-actions {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.login-actions .install-trigger {
    border: 1px solid var(--login-input-edge);
    color: #edf3fb;
    background: var(--login-soft-button);
}

.login-actions .install-trigger:hover {
    background: var(--login-soft-button-hover);
    border-color: #4d6284;
    transform: translateY(-1px);
}

.login-actions .install-trigger[hidden] {
    display: none;
}

.login-actions .ui-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.login-actions .ui-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.login-footer {
    margin-top: 12px;
    color: #9fb0c9;
    font-size: 13px;
    line-height: 1.45;
}

.login-footer a {
    color: #9fc5ff;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

[data-install-hint] {
    display: none;
}

html.theme-light .eyebrow,
html.theme-light label,
html.theme-light h1 {
    color: var(--login-text);
}
