/* Os ecrãs de entrada e desbloqueio mantêm a marca, o título e o formulário no mesmo fluxo visual. */

.pv-page {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.pv-gate {
    width: min(100%, 460px);
    margin: 0 auto;
    padding: var(--space-8) var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.pv-gate[hidden] {
    display: none;
}

.pv-gate__mark {
    align-self: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-6);
    border: 1px solid var(--accent-border);
    border-radius: 16px;
    background: var(--accent-subtle);
    color: var(--accent-text);
}

.pv-gate__mark .pv-icon {
    width: 26px;
    height: 26px;
}

.pv-gate__title {
    margin: 0;
    color: var(--text-primary);
    font-size: clamp(26px, 4vw, var(--type-display));
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-align: center;
}

.pv-gate__lead {
    margin: var(--space-3) 0 var(--space-7);
    color: var(--text-tertiary);
    font-size: var(--type-body);
    line-height: 1.6;
    text-align: center;
}

.pv-gate__status {
    min-height: 20px;
    margin: var(--space-5) auto 0;
    color: var(--text-secondary);
    font-size: var(--type-caption);
    line-height: 1.6;
    text-align: center;
}

/* --- The form ------------------------------------------------------------------------------------------------ */

.pv-form {
    display: grid;
    gap: var(--space-2);
}

.pv-form label {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 550;
}

/* 16px on purpose: below that, iOS zooms the page in when a field is focused. */
.pv-form input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-1);
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
}

.pv-form input:focus-visible {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px var(--focus-glow);
}

.otp-code-field {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    min-height: 48px;
}

.otp-code-field > span {
    display: grid;
    min-width: 0;
    min-height: 48px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: var(--surface-1);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 16px;
}

.otp-code-field[data-otp-focused="true"] > span[data-otp-active="true"] {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 1px var(--focus-glow);
}

.otp-code-field input[data-vault-code],
.otp-code-field input[data-vault-enroll-code],
.otp-code-field input[data-vault-legacy-code] {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    color: transparent;
    caret-color: transparent;
    -webkit-text-fill-color: transparent;
}

.pv-page .otp-code-field input:focus-visible {
    border: 0;
    outline: 0;
    outline-offset: 0;
    box-shadow: none;
}

.pv-form > .pv-button {
    margin-top: var(--space-2);
}

.pv-field-input {
    position: relative;
}

.pv-field-input input {
    padding-right: 52px;
}

.pv-field-input .pv-iconbutton {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
}

/* The entry form's password field carries two buttons (reveal, generate): the second sits further left, and
   the input keeps clear of both instead of hiding under the last one drawn. Every other .pv-field-input has
   only one button and stays as it was. */
.pv-field-input--dual .pv-iconbutton:nth-of-type(2) {
    right: 44px;
}

.pv-field-input--dual input {
    padding-right: 90px;
}

.pv-form textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 14px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-1);
    color: var(--text-primary);
    font: inherit;
    font-size: 16px;
    resize: vertical;
}

.pv-form textarea:focus-visible {
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 3px var(--focus-glow);
}

.pv-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 14px;
    color: var(--text-primary);
}

/* --- First registration of the authenticator ---------------------------------------------------------------- */

.pv-setup {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
}

.pv-setup summary {
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.pv-setup p {
    margin: var(--space-3) 0 0;
    color: var(--text-tertiary);
    font-size: var(--type-caption);
    line-height: 1.55;
}

.pv-setup label {
    display: block;
    margin: var(--space-4) 0 var(--space-2);
}

.pv-setup input {
    height: 44px;
}

.pv-setup .pv-button {
    width: 100%;
    margin-top: var(--space-3);
}
.pv-gate__logo { display: block; width: 58px; height: 58px; object-fit: contain; margin: 0 auto 20px; }
.pv-rail img.pv-rail__brand { display: block; width: 32px; height: 32px; object-fit: contain; margin: 10px auto 22px; padding: 0; border-radius: 0; background: transparent; }
.pv-step { color: var(--accent-text); font-weight: 700; }
