/* YMS Login — painel institucional à esquerda (ilustração do próprio YMS) e
 * cartão de acesso à direita. Carregado antes do design-system.css, por isso
 * os seletores são qualificados por .auth-card/.auth-left. */
html,
body,
#page-top {
    width: 100%;
    min-height: 100%;
    height: 100%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: #f3f5f9;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.content-wrapper {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.authentication-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #f3f5f9;
}

/* ---------------------------------------------------------------------
 * Painel institucional
 * ------------------------------------------------------------------- */
.auth-left {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    align-items: center;
    padding: clamp(2rem, 5vw, 4.5rem);
    overflow: hidden;
    color: #fff;
    /* A foto já traz o degradê azul-marinho à esquerda; a camada extra só
     * reforça o contraste do texto, sem cobrir os caminhões. */
    background-color: #0a2350;
    background-image:
        linear-gradient(90deg, rgba(7, 26, 56, .9) 0%, rgba(7, 26, 56, .72) 30%, rgba(7, 26, 56, 0) 56%),
        url("/img/shibata-login-fundo.png");
    /* Ancorada à esquerda: a faixa azul-marinho da foto fica sob o texto e
     * o corte, quando há, acontece no céu à direita. */
    background-position: center, left center;
    background-repeat: no-repeat;
    background-size: cover, cover;
}

/* Filete vermelho discreto na base, como acento da marca. */
.auth-left::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(202, 33, 40, .85) 50%, transparent);
}

.auth-left-content {
    position: relative;
    z-index: 1;
    width: min(100%, 440px);
}

.auth-accent {
    display: block;
    width: 36px;
    height: 3px;
    margin-bottom: 1.75rem;
    border-radius: 2px;
    background: #ca2128;
}

.auth-hero-title {
    display: flex;
    flex-direction: column;
    margin: 0 0 1rem;
    color: #fff;
    line-height: 1.1;
}

.auth-hero-light {
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    font-weight: 400;
}

.auth-hero-strong {
    font-size: clamp(2.2rem, 3.6vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -.01em;
}

.auth-hero-text {
    max-width: 360px;
    margin: 0 0 2rem;
    color: #d3deed;
    font-size: 1rem;
    line-height: 1.55;
}

.operational-features-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: .9rem;
}

.feature-icon {
    display: inline-flex;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-size: 1.25rem;
}

.feature-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.feature-text strong {
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
}

.feature-text span {
    color: #c3d0e2;
    font-size: .82rem;
}

/* ---------------------------------------------------------------------
 * Coluna do formulário
 * ------------------------------------------------------------------- */
.auth-right {
    display: flex;
    flex: 0 0 auto;
    width: clamp(380px, 28vw, 460px);
    height: 100%;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem;
    overflow-y: auto;
    background: #f3f5f9;
}

.auth-form-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    padding: 2rem 1.75rem 1.5rem;
    border: 1px solid #e3e8f0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 35, 65, .08);
}

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

/* A imagem tem margem branca embutida; object-fit recorta só o logotipo. */
.auth-card .auth-card-logo {
    display: block;
    width: 220px;
    height: 74px;
    object-fit: cover;
}

.auth-card-subtitle {
    margin: 0 0 1.5rem;
    color: #56667b;
    font-size: .9rem;
    text-align: center;
}

/* Abas CPF | Usuário */
.login-mode-tabs {
    display: flex;
    margin-bottom: 1.35rem;
    border-bottom: 1px solid #e3e8f0;
}

.login-mode-tab {
    flex: 1 1 0;
    margin-bottom: -1px;
    padding: .6rem .5rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: #56667b;
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.login-mode-tab:hover {
    color: #17396f;
}

.login-mode-tab.active {
    border-bottom-color: #24519b;
    color: #24519b;
    font-weight: 600;
}

.login-mode-tab:focus-visible {
    outline: 2px solid #24519b;
    outline-offset: -2px;
}

/* Campos */
.login-field {
    margin-bottom: 1.1rem;
}

.login-field-heading {
    display: flex;
    align-items: center;
    gap: .25rem;
    margin-bottom: .4rem;
}

.auth-card .login-field-heading .form-label {
    margin: 0;
    color: #1f2937;
    font-size: .8rem;
    font-weight: 600;
    text-transform: none;
}

.login-required {
    color: #ca2128;
    font-size: .8rem;
    font-weight: 700;
}

.input-group-custom {
    display: flex;
    align-items: stretch;
    min-height: 46px;
    overflow: hidden;
    border: 1px solid #d6deea;
    border-radius: 8px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input-group-custom:focus-within {
    border-color: #24519b;
    box-shadow: 0 0 0 3px rgba(36, 81, 155, .15);
}

.input-addon {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e3e8f0;
    background: #f6f8fb;
    color: #56667b;
    font-size: 1.1rem;
}

.auth-card .input-group-custom input.form-control {
    flex: 1 1 auto;
    min-width: 0;
    height: auto;
    min-height: 44px;
    padding: 0 .85rem;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: #1f2937;
    font-size: .95rem;
}

.auth-card .input-group-custom input.form-control::placeholder {
    color: #8a97a8;
}

.password-toggle {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-left: 1px solid #e3e8f0;
    background: transparent;
    color: #56667b;
    font-size: 1.15rem;
    cursor: pointer;
}

.password-toggle:hover {
    background: #eef3fa;
    color: #24519b;
}

.password-toggle:focus-visible {
    outline: 2px solid #24519b;
    outline-offset: -2px;
}

.login-field-hint {
    display: block;
    margin-top: .35rem;
    color: #56667b;
    font-size: .74rem;
}

/* Botão principal */
.btn-login-custom {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    margin-top: .5rem;
    border: 0;
    border-radius: 8px;
    background: #17396f;
    color: #fff;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.btn-login-custom:hover {
    background: #102a54;
}

.btn-login-custom:focus-visible {
    outline: 3px solid rgba(36, 81, 155, .35);
    outline-offset: 2px;
}

.btn-login-custom:disabled {
    cursor: wait;
    opacity: .9;
}

.btn-login-custom i {
    font-size: 1.2rem;
}

.login-button-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-right-color: #fff;
    border-radius: 50%;
    animation: login-spin .7s linear infinite;
}

.login-button-spinner.is-visible {
    display: inline-block;
}

.is-hidden {
    display: none !important;
}

/* "Ambiente seguro" entre linhas, como na referência. */
.login-security-note {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-top: 1.25rem;
    color: #1d7a4b;
    font-size: .76rem;
    font-weight: 600;
    white-space: nowrap;
}

.login-security-note::before,
.login-security-note::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: #e3e8f0;
}

.login-security-note i {
    font-size: 1rem;
}

.login-security-note span {
    margin-left: -.35rem;
}

.login-legal {
    margin: .9rem 0 0;
    color: #6b7a8f;
    font-size: .66rem;
    line-height: 1.45;
    text-align: center;
}

.login-legal a {
    color: #4d6385;
    text-decoration: underline;
}

.auth-copyright {
    margin: 1rem 0 0;
    color: #6b7a8f;
    font-size: .74rem;
    text-align: center;
}

.grecaptcha-badge {
    visibility: hidden !important;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------------------------
 * Tablet e celular: só o cartão, centralizado e com rolagem natural.
 * ------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    html,
    body,
    #page-top,
    .content-wrapper {
        height: auto;
        min-height: 100%;
        overflow-y: auto;
    }

    .authentication-wrapper {
        display: block;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .auth-right {
        width: 100%;
        min-height: 100vh;
        height: auto;
        padding: 2rem 1rem;
        overflow: visible;
        /* Faixa azul-marinho no topo mantém a identidade do painel. */
        background:
            linear-gradient(180deg, #071a38 0, #102a4c 180px, #f3f5f9 180px) no-repeat;
    }

    .auth-form-container {
        max-width: 420px;
    }
}

@media (max-width: 575.98px) {
    .auth-card {
        padding: 1.6rem 1.15rem 1.25rem;
    }

    .auth-card .input-group-custom input.form-control {
        font-size: 16px; /* evita zoom automático no iOS */
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-login-custom,
    .input-group-custom,
    .login-mode-tab {
        transition: none;
    }

    .login-button-spinner {
        animation-duration: 1.2s;
    }
}
