/* Registo e pagamento da licença: moldura da página, passos, campos, plano, cupão, método e resumo
   (register.php e renew-license.php). */
.lc {
    --lc-ink: var(--ui-text);
    --lc-muted: var(--ui-cool-500);
    --lc-line: #dde1e6;
    --lc-line-strong: #b9c0ca;
    --lc-surface: var(--ui-white);
    --lc-accent: var(--ui-brand);
    --lc-positive: var(--ui-green-700);
    color: var(--lc-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.lc,
.lc * {
    box-sizing: border-box;
}

.lc [hidden] {
    display: none !important;
}

.lc-stack {
    display: grid;
    gap: 28px;
}

.lc-section {
    display: grid;
    gap: 12px;
    min-width: 0;
}

.lc-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.lc-label {
    margin: 0;
    color: var(--lc-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0;
}

.lc-hint {
    margin: 2px 0 0;
    color: var(--lc-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

/* Alternador mensal/anual */
.lc-cycle {
    display: inline-flex;
    padding: 3px;
    border-radius: 8px;
    background: var(--ui-cool-100);
}

.lc-cycle button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--lc-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.lc-cycle button:hover {
    color: var(--lc-ink);
}

.lc-cycle button.active {
    background: var(--lc-surface);
    color: var(--lc-ink);
    box-shadow: 0 1px 2px rgba(17, 19, 21, 0.12);
}

.lc-cycle-saving,
.lc-saving {
    color: var(--lc-positive);
    font-weight: 500;
}

.lc-cycle-saving {
    font-size: 12px;
}

/* Opções selecionáveis (planos e métodos de pagamento) */
.lc-plans,
.lc-methods {
    display: grid;
    gap: 8px;
}

.lc-methods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lc-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--lc-line);
    border-radius: 8px;
    background: var(--lc-surface);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lc-option:hover {
    border-color: var(--lc-line-strong);
}

.lc-option:has(input:checked) {
    border-color: var(--lc-accent);
    box-shadow: 0 0 0 1px var(--lc-accent);
}

.lc-option:has(input:focus-visible) {
    outline: 2px solid rgba(236, 105, 40, 0.4);
    outline-offset: 2px;
}

.lc-option input {
    flex: none;
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    border: 1.5px solid var(--lc-line-strong);
    border-radius: 50%;
    background: var(--lc-surface);
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease, border-width 0.15s ease;
}

.lc-option input:checked {
    border: 5px solid var(--lc-accent);
}

.lc-option-body {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.lc-option-title {
    color: var(--lc-ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.lc-option-desc {
    color: var(--lc-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.lc-plan-price {
    display: grid;
    gap: 2px;
    flex: none;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lc-plan-amount {
    color: var(--lc-ink);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
}

.lc-plan-amount small {
    margin-left: 2px;
    color: var(--lc-muted);
    font-size: 13px;
    font-weight: 400;
}

.lc-plan-note {
    color: var(--lc-muted);
    font-size: 12px;
    line-height: 1.45;
}

.lc-empty {
    padding: 16px;
    border: 1px dashed var(--lc-line-strong);
    border-radius: 8px;
    color: var(--lc-muted);
    font-size: 13px;
}

/* Campos */
.lc .auth-field {
    gap: 6px;
}

.lc .auth-field label {
    color: var(--lc-ink);
    font-size: 13px;
    font-weight: 500;
}

/* Cupão: fechado por omissão para não competir com o essencial */
.lc-coupon > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    color: var(--lc-ink);
    font-size: 13px;
    font-weight: 500;
    list-style: none;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--lc-line-strong);
    text-underline-offset: 3px;
}

.lc-coupon > summary::-webkit-details-marker {
    display: none;
}

.lc-coupon > summary:hover {
    text-decoration-color: currentColor;
}

.lc-coupon > summary:focus-visible {
    outline: 2px solid rgba(236, 105, 40, 0.4);
    outline-offset: 3px;
    border-radius: 4px;
}

.lc-coupon[open] > summary {
    margin-bottom: 10px;
    color: var(--lc-muted);
    text-decoration: none;
    font-weight: 500;
}

.lc-coupon-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.lc .lc-coupon-row .auth-secondary {
    width: auto;
    min-height: 0;
    padding: 0 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
}

.lc .lc-status.auth-alert {
    margin: 8px 0 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 13px;
    line-height: 1.5;
}

/* Resumo */
.lc-summary {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid var(--lc-line);
    font-variant-numeric: tabular-nums;
}

.lc-summary > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.lc-summary dt {
    color: var(--lc-muted);
    font-size: 14px;
    font-weight: 400;
}

.lc-summary dd {
    margin: 0;
    color: var(--lc-ink);
    font-size: 14px;
    white-space: nowrap;
}

.lc-summary dd.lc-saving {
    color: var(--lc-positive);
}

.lc-summary .lc-summary-total {
    margin-top: 4px;
}

.lc-summary .lc-summary-total dt {
    color: var(--lc-ink);
    font-weight: 600;
}

.lc-summary .lc-summary-total dd {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.lc-footnote {
    margin: 0;
    color: var(--lc-muted);
    font-size: 13px;
    line-height: 1.5;
}

.lc-pay {
    display: grid;
    gap: 16px;
}

/* Página de renovação */
.lc-page {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    display: block;
    background: var(--ui-bg);
}

.lc-shell {
    width: min(600px, 100%);
    margin: 0 auto;
    padding: 32px 20px 56px;
}

.lc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.lc-brand {
    color: var(--lc-ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.lc-exit {
    color: var(--lc-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.lc-exit:hover {
    color: var(--lc-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lc-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: -4px 0 20px;
    color: var(--lc-muted);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.lc-back:hover {
    color: var(--lc-ink);
}

.lc-back svg {
    width: 15px;
    height: 15px;
}

.lc-card {
    padding: 32px;
    border: 1px solid var(--lc-line);
    border-radius: 12px;
    background: var(--lc-surface);
}

.lc-intro {
    margin-bottom: 28px;
}

.lc-intro h1 {
    margin: 0;
    color: var(--lc-ink);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.lc-intro p {
    margin: 6px 0 0;
    color: var(--lc-muted);
    font-size: 14px;
    line-height: 1.55;
}

.lc-page .auth-alert {
    margin-bottom: 24px;
    align-items: flex-start;
}

.lc-page .auth-alert svg {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.lc-page .auth-input {
    min-height: 42px;
    border-color: var(--lc-line);
    background: var(--lc-surface);
}

.lc-page .auth-input:focus-within {
    border-color: var(--lc-accent);
    box-shadow: 0 0 0 3px rgba(236, 105, 40, 0.14);
}

.lc-page .auth-input input {
    font-size: 15px;
}

.lc-page .auth-submit {
    width: 100%;
    min-height: 44px;
    background: var(--lc-accent);
    box-shadow: none;
    font-size: 15px;
    font-weight: 600;
}

.lc-page .auth-submit:hover {
    background: var(--ui-brand-dark);
    box-shadow: none;
}

.lc-page .auth-submit:focus-visible,
.lc-page .auth-secondary:focus-visible,
.lc-page a:focus-visible,
.lc-cycle button:focus-visible {
    outline: 2px solid rgba(236, 105, 40, 0.5);
    outline-offset: 2px;
}

.lc-page button {
    font-family: inherit;
}

.lc-top-note {
    color: var(--lc-muted);
    font-size: 13px;
}

.lc-top-note a {
    color: var(--lc-ink);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--lc-line-strong);
    text-underline-offset: 3px;
}

.lc-top-note a:hover {
    text-decoration-color: currentColor;
}

.lc-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.lc-intro h1:focus {
    outline: none;
}

.lc-optional {
    color: var(--lc-muted);
    font-weight: 400;
}

/* Passos do registo */
.lc-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 28px;
    padding: 0;
    list-style: none;
}

.lc-page .lc-steps .auth-step {
    width: 100%;
    min-height: 0;
    padding: 10px 0 0;
    border: 0;
    border-top: 2px solid var(--lc-line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 4px;
    color: var(--lc-muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.lc-page .lc-steps .auth-step span {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: inherit;
    font-size: inherit;
    font-variant-numeric: tabular-nums;
}

.lc-page .lc-steps .auth-step:hover {
    color: var(--lc-ink);
}

.lc-page .lc-steps .auth-step.complete {
    border-top-color: var(--lc-accent);
    color: var(--lc-ink);
}

.lc-page .lc-steps .auth-step.active {
    border-top-color: var(--lc-accent);
    color: var(--lc-ink);
    font-weight: 600;
}

.lc-page .lc-steps .auth-step:focus-visible {
    outline: 2px solid rgba(236, 105, 40, 0.5);
    outline-offset: 4px;
}

/* Formulário por passos */
.lc-page .step-content.active {
    display: grid;
    gap: 20px;
}

.lc-page .auth-grid {
    gap: 16px;
    align-items: start;
}

.lc-page .auth-field {
    align-content: start;
}

.lc-page .auth-input:has([aria-invalid="true"]) {
    border-color: var(--ui-red-600);
}

.lc-page .auth-input:has([aria-invalid="true"]):focus-within {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.lc-page .register-field-error {
    color: var(--ui-red-700);
    font-size: 13px;
    line-height: 1.5;
}

.lc-page .password-strength {
    display: none;
}

.lc-page .auth-input-action {
    margin-right: -4px;
}

.lc-page .auth-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    margin-top: 8px;
}

.lc-page .auth-actions .auth-submit {
    flex: 1;
    width: auto;
}

.lc-page .auth-secondary {
    min-height: 44px;
    border-color: var(--lc-line);
    background: var(--lc-surface);
    color: var(--lc-ink);
    font-size: 14px;
    font-weight: 500;
    box-shadow: none;
}

.lc-page .auth-secondary:hover {
    border-color: var(--lc-line-strong);
    background: var(--lc-surface);
}

.lc-page .auth-actions .auth-secondary {
    flex: none;
    width: auto;
    padding: 0 20px;
}

.lc-page .auth-submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.lc-page .lc-stack .auth-actions {
    margin-top: 0;
}

/* Página do pagamento (license-payment.php) */
.lc-intro-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.lc-state {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    margin-top: 6px;
    color: var(--lc-ink);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.lc-state::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d97706;
}

.lc-state[data-status="success"]::before {
    background: var(--ui-green-600);
}

.lc-state[data-status="failed"]::before,
.lc-state[data-status="expired"]::before,
.lc-state[data-status="cancelled"]::before {
    background: var(--ui-red-600);
}

.lc-stack > .auth-alert {
    margin: 0;
}

.lc-heading {
    margin: 0;
    color: var(--lc-ink);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.lc-instructions p {
    margin: 0;
    color: var(--ui-cool-800);
    font-size: 14px;
    line-height: 1.55;
}

.lc-instructions p strong {
    color: var(--lc-ink);
    font-weight: 600;
    white-space: nowrap;
}

.lc-qr {
    display: block;
    width: 180px;
    height: 180px;
    padding: 8px;
    border: 1px solid var(--lc-line);
    border-radius: 8px;
    background: #fff;
}

.lc-ref {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--lc-line);
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.lc-ref > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 16px;
}

.lc-ref dt {
    color: var(--lc-muted);
    font-size: 13px;
}

.lc-ref dd {
    margin: 0;
    color: var(--lc-ink);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
    user-select: all;
}

.lc-page .auth-actions .lc-grow {
    flex: 1;
}

.lc-pay .auth-actions {
    margin-top: 0;
}

.lc-pay .auth-actions:not(:has(> :not([hidden]))) {
    display: none;
}

@media (max-width: 560px) {
    .lc-shell {
        padding: 20px 16px 40px;
    }

    .lc-card {
        padding: 24px 20px;
    }

    .lc-methods {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    .lc-plan {
        flex-wrap: wrap;
    }

    .lc-plan-price {
        flex: 1 0 100%;
        padding-left: 28px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lc *,
    .lc *::before,
    .lc *::after {
        transition: none !important;
    }
}

.lc-page .auth-field:has([aria-invalid="true"]) > .lc-hint {
    display: none;
}
