/*
 * Métodos de autenticação externa nos ecrãs de autenticação.
 *
 * O layout auth não carrega Bootstrap; estas classes são autocontidas.
 * Google e Facebook partilham a mesma composição visual e comportamento
 * de elevação, mantendo apenas os respetivos elementos de identidade.
 */

.auth-external-methods {
    width: 100%;
    padding-top: 0.3rem;
}

.auth-external-button {
    width: 100%;
    min-height: 44px;
    gap: 0.65rem;
    border: 1px solid rgba(78, 91, 83, 0.24);
    border-radius: 0.78rem;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #26352d;
    box-shadow: 0 0.18rem 0.45rem rgba(28, 48, 36, 0.06);
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.25;
}

.auth-external-button + .auth-external-button {
    margin-top: 0.55rem;
}

.auth-external-button:hover {
    border-color: rgba(25, 135, 84, 0.34);
    background: #ffffff;
    color: #17291f;
    box-shadow: 0 0.4rem 0.8rem rgba(28, 48, 36, 0.09);
    transform: translateY(-1px);
}

.auth-external-button:focus-visible {
    outline: 2px solid rgba(25, 135, 84, 0.3);
    outline-offset: 2px;
}

/* Google */
.auth-external-button-google .auth-external-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}

.auth-external-google-logo {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Facebook */
.auth-external-button-facebook .auth-external-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    color: #1877f2;
}

/* Separador entre métodos externos e autenticação local. */
.auth-external-divider {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin: -0.05rem 0;
}

.auth-external-divider-line {
    flex: 1 1 auto;
    height: 1px;
    background: rgba(70, 83, 64, 0.16);
}

.auth-external-divider-text {
    flex: 0 0 auto;
    color: #7a837e;
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

/* Registo externo já validado pelo provider. */
.auth-external-registration-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    border: 1px solid rgba(25, 135, 84, 0.22);
    border-radius: 0.85rem;
    padding: 0.85rem 0.95rem;
    background: rgba(25, 135, 84, 0.055);
}

.auth-external-registration-summary__identity {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-width: 0;
}

.auth-external-registration-summary__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(42, 55, 46, 0.08);
}

.auth-external-registration-summary__identity > div > strong,
.auth-external-registration-summary__identity > div > span {
    display: block;
}

.auth-external-registration-summary__icon > svg,
.auth-external-registration-summary__icon > img {
    display: block;
    width: 20px;
    height: 20px;
}

.auth-external-registration-summary__identity strong {
    color: #26352d;
    font-size: 0.9rem;
    font-weight: 800;
}

.auth-external-registration-summary__identity span {
    margin-top: 0.12rem;
    color: #68746d;
    font-size: 0.79rem;
    line-height: 1.35;
}

.auth-external-registration-summary__switch {
    display: inline-block;
    margin-top: 0.35rem;
    color: #315b43;
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: underline;
    text-underline-offset: 0.16rem;
}

.auth-external-registration-summary__switch:hover {
    color: #1d3f2d;
}

.auth-external-passwordless-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border-radius: 0.65rem;
    padding: 0.72rem 0.78rem;
    background: rgba(49, 91, 67, 0.07);
    color: #5d6b63;
    font-size: 0.8rem;
    line-height: 1.4;
}

.auth-external-passwordless-note i {
    margin-top: 0.13rem;
    color: #315b43;
}

/*
 * A presença de métodos externos acrescenta conteúdo ao cartão.
 * Compactamos ligeiramente apenas este caso para reduzir scroll em ecrãs
 * desktop de menor altura, sem alterar o login/registo normal.
 */
.auth-form-card-has-external .auth-panel-heading {
    margin-bottom: 0.8rem;
}

.auth-form-card-has-external .auth-form {
    gap: 0.72rem;
}

/*
 * O formulário principal tem scroll próprio. Reserva espaço inferior para a
 * sombra do botão de submissão e aproxima o comportamento visual dos botões
 * externos: sombra discreta em repouso e mais marcada no hover.
 */
.auth-form-card .auth-form {
    padding-bottom: 1.7rem;
}

.auth-form-card .auth-button {
    box-shadow: 0 0.18rem 0.45rem rgba(25, 135, 84, 0.16);
}

.auth-form-card .auth-button:hover:not(:disabled) {
    box-shadow: 0 0.4rem 0.8rem rgba(25, 135, 84, 0.22);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .auth-external-divider-text {
        font-size: 0.78rem;
    }

    .auth-external-registration-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-external-registration-summary__switch {
        margin-left: 2.72rem;
    }
}
