/* =========================================================================
   ForTrash — páginas de autenticação (login, registo, recuperação)
   Depende de fortrash-ui.css.
   ========================================================================= */

.auth {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 100vh;
}

@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
}

/* ------------------------------------------------------- painel lateral */
.auth-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(2rem, 4vw, 3.5rem);
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(40rem 30rem at 20% 15%, rgba(18, 217, 146, 0.35), transparent 60%),
        radial-gradient(36rem 28rem at 85% 80%, rgba(3, 195, 236, 0.28), transparent 62%),
        linear-gradient(150deg, #052e24 0%, #06382d 45%, #0a2540 100%);
}

/* Ondas no fundo: tema marinho sem imagem pesada. */
.auth-waves {
    position: absolute;
    inset: auto 0 0 0;
    height: 42%;
    opacity: 0.5;
    pointer-events: none;
}

.auth-aside-copy { position: relative; max-width: 30rem; }

.auth-aside h1 {
    font-family: var(--ft-font-display);
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 1rem;
}

.auth-aside p {
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.7;
    margin: 0;
}

.auth-aside .ft-brand-name,
.auth-aside a { color: #fff; }

.auth-metrics {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.auth-metric {
    flex: 1 1 8rem;
    padding: 0.9rem 1.1rem;
    border-radius: var(--ft-r);
    background: rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.auth-metric b {
    display: block;
    font-family: var(--ft-font-display);
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.auth-metric span {
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

/* ----------------------------------------------------------- formulário */
.auth-main {
    display: grid;
    place-items: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.auth-card {
    width: 100%;
    max-width: 27rem;
    padding: clamp(1.75rem, 3vw, 2.5rem);
}

/* O registo tem mais campos e precisa de mais largura. */
.auth-card-wide { max-width: 34rem; }

.auth-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--ft-ink-soft);
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--ft-green);
    cursor: pointer;
}

.auth-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--ft-green);
    text-decoration: none;
}

.auth-link:hover { text-decoration: underline; }

/* Reserva espaço para o layout não saltar quando a mensagem aparece. */
.auth-message {
    min-height: 1.35rem;
    margin: 0.9rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.auth-message.is-ok    { color: var(--ft-green); }
.auth-message.is-error { color: var(--ft-coral); }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin: 1.5rem 0;
    font-size: 0.8rem;
    color: var(--ft-ink-faint);
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ft-glass-border);
}

.ft-btn.is-loading { pointer-events: none; opacity: 0.75; }
.ft-btn.is-loading svg { animation: ft-spin 0.9s linear infinite; }

/* Grelha de campos do registo */
.auth-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: 0 1rem;
}

/* Passos do registo */
.auth-steps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ft-ink-faint);
}

.auth-step b {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    font-size: 0.78rem;
    background: color-mix(in srgb, var(--ft-ink) 8%, transparent);
}

.auth-step.is-on { color: var(--ft-green-deep); }
.auth-step.is-on b { color: #fff; background: var(--ft-green); }

.auth-steps hr {
    flex: 1;
    height: 1px;
    border: 0;
    background: var(--ft-glass-border);
    margin: 0;
}

/* --------------------------------------------------- selector de idioma */
.lang-switch {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem;
    border-radius: 999px;
    z-index: 20;
}

.lang-switch button {
    padding: 0.35rem 0.75rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ft-ink-soft);
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.lang-switch button.is-active,
.lang-switch .fortrash-lang-btn--active {
    color: #fff;
    background: var(--ft-green);
}

/* O widget flutuante do i18n-auth.js seria um segundo selector. */
#fortrash-lang-float { display: none; }

/* =========================================================================
   Variante minimalista — só o cartão centrado sobre a aurora.
   Usada no login, registo e recuperação: sem painel lateral, sem ilustração.
   ========================================================================= */
.auth-solo {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: clamp(1.5rem, 5vw, 3rem);
}

.auth-solo-card {
    width: 100%;
    max-width: 24rem;
}

.auth-solo-card-wide { max-width: 30rem; }

.auth-solo-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.auth-solo-title {
    font-family: var(--ft-font-display);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
}

.auth-solo-sub {
    margin: 0 0 2rem;
    font-size: 0.92rem;
    color: var(--ft-ink-soft);
}

/* Sem moldura nem vidro: os campos e o botão bastam. A profundidade vem
   do fundo, não de uma caixa em cima de outra caixa. */
.auth-solo .ft-input {
    background: rgba(255, 255, 255, 0.75);
}

.auth-solo-foot {
    margin: 2rem 0 0;
    font-size: 0.9rem;
    color: var(--ft-ink-soft);
    text-align: center;
}

.auth-solo-lang {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    gap: 0.2rem;
    padding: 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--ft-glass-border);
}

.auth-solo-lang button {
    padding: 0.3rem 0.7rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ft-ink-soft);
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}

.auth-solo-lang .fortrash-lang-btn--active {
    color: #fff;
    background: var(--ft-green);
}

/* Passos do registo, versão discreta */
.auth-solo .auth-steps { margin-bottom: 2rem; }


/* ------------------------------------------------ telemóvel com indicativo */
.phone-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 0.5rem;
}

.phone-prefix {
    text-align: center;
    font-weight: 600;
    color: var(--ft-ink-soft);
    background: color-mix(in srgb, var(--ft-ink) 4%, transparent);
    cursor: default;
}

/* Código OTP: dígitos largos e espaçados, para se lerem ao conferir o SMS. */
.code-input {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    text-align: center;
    text-indent: 0.5em;
    font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------- lista suspensa */
/* .ft-select vive em ft-app.css, que as páginas de autenticação não carregam. */
.ft-select {
    width: 100%;
    padding: 0.85rem 2.25rem 0.85rem 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--ft-ink);
    background-color: var(--ft-glass-strong);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.1rem;
    border: 1px solid var(--ft-glass-border);
    border-radius: var(--ft-r-sm);
    appearance: none;
    outline: none;
    cursor: pointer;
}

.ft-select:focus {
    border-color: var(--ft-green);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ft-green) 18%, transparent);
}

/* Alerta informativo (linha do email em confirmação) */
.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: var(--ft-r);
    font-size: 0.9rem;
    color: var(--ft-accent, var(--ft-green-deep));
    background: color-mix(in srgb, var(--ft-accent, var(--ft-green)) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--ft-accent, var(--ft-green)) 24%, transparent);
}

.alert-info { --ft-accent: var(--ft-aqua); }
