@font-face {
    font-family: "Disney TV";
    src: url("assets/fonts/disney_regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Disney TV";
    src: url("assets/fonts/disney_bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-top: #101c32;
    --bg-bottom: #070e1c;
    --overlay-top: rgba(20, 33, 58, 0.6);
    --overlay-bottom: rgba(5, 11, 21, 0.6);
    --field: #182233;
    --field-hover: #1d293c;
    --accent: #0878f9;
    --accent-hover: #1a86ff;
    --text: #ffffff;
    --muted: #bac2d0;
    --icon: #bec4cf;
    --error: #ff6674;
    --radius: 6px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background:
        linear-gradient(180deg, var(--overlay-top) 0%, var(--overlay-bottom) 100%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    background-attachment: fixed;
}

body {
    margin: 0;
    min-height: 100dvh;
    color: var(--text);
    font-family: "Disney TV", "Segoe UI", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.login {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vh, 56px) clamp(16px, 4vw, 48px);
}

.login-group {
    width: min(100%, 670px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    position: relative;
    width: clamp(190px, 24vw, 300px);
    aspect-ratio: 300 / 156;
    overflow: hidden;
    flex: none;
}

/* O PNG original tem bastante margem transparente; 170% replica o
   enquadramento usado pelo APK (300x156 visíveis). */
.login-logo img {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 170%;
    max-width: none;
    height: auto;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 18px rgba(8, 120, 249, 0.28));
}

.login-title {
    margin: clamp(14px, 2.2vw, 24px) 0 0;
    font-size: clamp(30px, 4vw, 38px);
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.01em;
    text-align: center;
}

.login-subtitle {
    margin: 0 0 clamp(18px, 2.8vw, 30px);
    color: var(--muted);
    font-size: clamp(16px, 2.4vw, 24px);
    font-weight: 400;
    line-height: 1.45;
    text-align: center;
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.field {
    position: relative;
    display: flex;
    align-items: center;
    height: clamp(62px, 7vw, 80px);
    margin: 0 0 clamp(16px, 3vw, 30px);
    background: var(--field);
    border: 2px solid transparent;
    border-radius: var(--radius);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.field:hover {
    background: var(--field-hover);
}

.field:focus-within {
    border-color: #ffffff;
}

.field-icon {
    width: clamp(21px, 2.4vw, 30px);
    height: clamp(21px, 2.4vw, 30px);
    margin: 0 clamp(14px, 2vw, 26px) 0 clamp(18px, 2.6vw, 32px);
    flex: none;
    color: var(--icon);
}

.field input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 8px 0 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: clamp(17px, 2vw, 27px);
    font-weight: 400;
}

.field input::placeholder {
    color: #8d99ad;
    opacity: 1;
}

.field-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: clamp(50px, 5.4vw, 70px);
    margin: 0;
    padding: 0;
    flex: none;
    border: 0;
    background: transparent;
    color: var(--icon);
    cursor: pointer;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.field-toggle svg {
    width: clamp(20px, 2.2vw, 28px);
    height: clamp(20px, 2.2vw, 28px);
}

.field-toggle:hover,
.field-toggle:focus-visible {
    color: #ffffff;
}

.field-toggle:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -4px;
}

.field-toggle .eye-off {
    display: none;
}

.field-toggle.is-visible .eye-on {
    display: none;
}

.field-toggle.is-visible .eye-off {
    display: block;
}

.button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    width: 100%;
    height: clamp(62px, 7.4vw, 84px);
    padding: 0 clamp(16px, 2vw, 24px);
    border: 2px solid transparent;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: clamp(20px, 2.5vw, 32px);
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.button-primary {
    background: var(--accent);
}

.button-primary:hover {
    background: var(--accent-hover);
}

.button-primary:active {
    transform: scale(0.995);
}

.button:focus-visible {
    outline: none;
    border-color: #ffffff;
}

.login-status {
    min-height: clamp(32px, 4vw, 40px);
    margin: 8px 0 0;
    color: var(--error);
    font-size: clamp(14px, 1.5vw, 17px);
    line-height: 1.3;
    text-align: center;
}

@media (max-width: 520px) {
    .login-title {
        margin-top: 12px;
    }

    .login-subtitle {
        margin-bottom: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .field,
    .button {
        transition: none;
    }
}

/* ---------- Instalação, login e licença ---------- */

:root {
    --success: #5ce1b2;
    --warning: #ffb86b;
}

.login--top {
    align-items: flex-start;
    padding-top: clamp(18px, 4vh, 48px);
    padding-bottom: clamp(18px, 4vh, 48px);
}

.login-group--wide {
    width: min(100%, 780px);
}

.login-group--wide .login-title {
    font-size: clamp(26px, 3.4vw, 36px);
}

.login-group--wide .login-subtitle {
    font-size: clamp(14px, 1.8vw, 18px);
    margin-bottom: clamp(14px, 2vw, 22px);
}

.login-form--compact .field {
    height: clamp(54px, 5.8vw, 66px);
    margin-bottom: 13px;
}

.login-form--compact .field input {
    font-size: clamp(15px, 1.5vw, 20px);
}

.login-form--compact .field-icon {
    width: clamp(19px, 2vw, 24px);
    height: clamp(19px, 2vw, 24px);
}

.login-form--compact .button {
    height: clamp(54px, 6vw, 66px);
    font-size: clamp(17px, 2vw, 24px);
}

.login-form--compact .field-toggle {
    width: clamp(44px, 4.8vw, 58px);
}

.login-form--compact .field-toggle svg {
    width: clamp(18px, 1.9vw, 24px);
    height: clamp(18px, 1.9vw, 24px);
}

.login-note {
    margin: 12px 0 0;
    color: #8695ad;
    font-size: 12px;
    line-height: 1.55;
    text-align: center;
}

.login-note a {
    color: #8fc5ff;
    text-decoration: none;
}

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

.login-note code {
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: #d8e5f7;
}

.login-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #7687a2;
    font-size: 11.5px;
    text-align: center;
}

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

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

.steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0 0 clamp(18px, 2.4vw, 26px);
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: #6f809a;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.step-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: #9aabc4;
    font-size: 11px;
    font-weight: 800;
    flex: none;
}

.step.is-done .step-dot {
    border-color: rgba(92, 225, 178, 0.3);
    background: rgba(92, 225, 178, 0.12);
    color: var(--success);
}

.step.is-current {
    color: #eaf1fc;
}

.step.is-current .step-dot {
    border-color: rgba(8, 120, 249, 0.4);
    background: rgba(8, 120, 249, 0.18);
    color: #c7e3ff;
    box-shadow: 0 0 0 4px rgba(8, 120, 249, 0.08);
}

.step-line {
    width: 28px;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    flex: none;
}

.notice {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    text-align: left;
}

.notice svg {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    flex: none;
}

.notice--danger {
    border-color: rgba(255, 102, 116, 0.28);
    background: rgba(255, 102, 116, 0.08);
    color: #ffb3ba;
}

.notice--success {
    border-color: rgba(92, 225, 178, 0.28);
    background: rgba(92, 225, 178, 0.08);
    color: #a9f2d3;
}

.notice--warning {
    border-color: rgba(255, 184, 107, 0.28);
    background: rgba(255, 184, 107, 0.08);
    color: #ffd39b;
}

.req-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    margin: 0 0 18px;
}

.req-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.025);
    text-align: left;
}

.req-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    flex: none;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.req-item.is-ok .req-icon {
    background: rgba(92, 225, 178, 0.16);
    color: var(--success);
}

.req-item.is-bad .req-icon {
    background: rgba(255, 102, 116, 0.16);
    color: var(--error);
}

.req-item.is-warning .req-icon {
    background: rgba(255, 184, 107, 0.16);
    color: var(--warning);
}

.req-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.req-copy strong {
    color: #eaf1fc;
    font-size: 12.5px;
    font-weight: 700;
}

.req-copy small {
    margin-top: 2px;
    color: #8a99b1;
    font-size: 11.5px;
    line-height: 1.4;
    word-break: break-word;
}

.button-secondary {
    height: clamp(48px, 5.4vw, 60px);
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
    color: #cfdcef;
    font-size: clamp(15px, 1.7vw, 20px);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.button-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}

.button-row .button {
    flex: 1;
}

.button--link {
    height: auto;
    min-height: 36px;
    padding: 0 10px;
    background: transparent;
    color: #8fc5ff;
    font-size: 13px;
    text-decoration: none;
}

.button--link:hover {
    background: rgba(8, 120, 249, 0.1);
    color: #c7e3ff;
}

.license-summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin: 0 0 16px;
    padding: 13px 14px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.03);
    text-align: left;
}

.license-summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    font-size: 12px;
}

.license-summary-row span {
    color: #7f8fa8;
    flex: none;
}

.license-summary-row strong {
    overflow-wrap: anywhere;
    color: #dbe7f8;
    font-size: 12.5px;
    font-weight: 700;
    text-align: right;
}

.license-summary-row code {
    color: #a9d2ff;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11.5px;
}

.login-status.is-success {
    color: var(--success);
}

.login-logo--compact {
    width: clamp(130px, 16vw, 190px);
}

.button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.button-primary:disabled:hover {
    background: var(--accent);
}

.field input.license-key {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.login-footer {
    flex-wrap: wrap;
    row-gap: 8px;
}

@media (max-width: 620px) {
    .steps {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .step {
        font-size: 10px;
    }

    .step-line {
        width: 16px;
    }

    .button-row {
        flex-direction: column;
    }
}
