/* ============================================================
   SEMED — tela de login compartilhada (gateway + sistemas)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

.login-page {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--sm-text, #1c2b30);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-page h1,
.login-page h2 {
    font-family: inherit;
}

.login-split {
    display: grid;
    grid-template-columns: minmax(380px, 44%) 1fr;
    min-height: 100vh;
}

.login-brand {
    background: linear-gradient(155deg, var(--brand-900) 0%, var(--brand-700) 65%, var(--brand-500) 140%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 56px 52px;
    position: relative;
    overflow: hidden;
}

.login-brand::after {
    content: "";
    position: absolute;
    inset: auto -120px -160px auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(64, 200, 219, .38), transparent 70%);
}

.brand-badge {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, .12);
    font-size: 28px;
    margin-bottom: 28px;
}

.login-brand h1 { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 0; }

.brand-sub { margin-top: 8px; font-size: 15px; color: rgba(255, 255, 255, .75); }

.brand-points { list-style: none; margin-top: 40px; display: grid; gap: 16px; padding: 0; }

.brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14.5px;
    color: rgba(255, 255, 255, .9);
}

.brand-points i {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, .1);
    font-size: 14px;
}

.brand-footer {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand-footer-logo {
    width: 270px;
    max-width: 45%;
    height: auto;
    display: block;
    flex-shrink: 0;
}

.brand-footer-note {
    margin-top: 0;
    font-size: 11.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .72);
    flex: 1;
    border-left: 1px solid rgba(255, 255, 255, .22);
    padding-left: 18px;
}

.brand-footer-note a {
    color: inherit;
    text-decoration: none;
}

.brand-footer-note a:hover {
    text-decoration: underline;
}

.login-form-panel {
    display: grid;
    place-items: center;
    padding: 40px 24px;
    position: relative;
    background: var(--sm-bg, #eef5f6);
}

.login-theme-slot {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
}

.sm-theme-switch--login {
    box-shadow: 0 2px 8px rgba(6, 62, 72, .12);
}

.login-card {
    width: 100%;
    max-width: 400px;
    min-width: 0;
    background: var(--sm-surface, #fff);
    border: 1px solid var(--sm-border, #dbe7ea);
    border-radius: 14px;
    box-shadow: var(--sm-shadow, 0 10px 30px rgba(6, 62, 72, .12));
    padding: 40px 36px;
}

.login-card form {
    min-width: 0;
}

.login-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -.3px; margin: 0; }

.login-hint { margin: 6px 0 26px; font-size: 14px; color: var(--sm-text-soft, #566268); }

.login-card label.field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--sm-text, #1c2b30);
    margin: 16px 0 6px;
}

.login-card label.field-label:first-of-type { margin-top: 0; }

.login-field {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    border: 1.5px solid var(--sm-border, #dbe7ea);
    border-radius: 10px;
    background: var(--sm-surface, #fff);
    transition: border-color .15s, box-shadow .15s;
    overflow: hidden;
}

.login-field:focus-within {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(18, 175, 200, .18);
}

.login-field__prefix {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9aa5b5;
    font-size: 14px;
    pointer-events: none;
}

.login-field input {
    display: block;
    flex: 1;
    min-width: 0;
    width: 0;
    padding: 12px 14px 12px 0;
    font-size: 15px;
    font-family: inherit;
    border: none;
    border-radius: 0 8px 8px 0;
    outline: none;
    background: transparent;
    color: var(--sm-text, #1c2b30);
    box-shadow: none;
}

.login-field input:focus {
    outline: none;
    box-shadow: none;
}

.login-field.login-field--password input {
    padding-right: 0;
    border-radius: 0;
}

.password-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 4px;
    cursor: pointer;
    color: #9aa5b5;
    font-size: 15px;
    background: none;
    border: 0;
    padding: 0;
    line-height: 1;
}

.password-toggle:hover { color: var(--brand-700); }

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--sm-text-soft, #566268);
    cursor: pointer;
    user-select: none;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand-600, #0f9cb3);
    cursor: pointer;
    flex-shrink: 0;
}

.btn-login-submit {
    width: 100%;
    margin-top: 18px;
    padding: 13px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-800));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform .12s, box-shadow .12s;
}

.btn-login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 156, 179, .40);
}

a.btn-login-submit {
    text-decoration: none;
    box-sizing: border-box;
}

.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fdeeee;
    border: 1px solid #f3c8c8;
    color: #b3362f;
    font-size: 13.5px;
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 12px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--sm-text-soft, #566268);
    font-size: 12.5px;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--sm-border, #dbe7ea);
}

.login-secondary-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-login-secondary {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
    transition: all .15s;
    border: 1.5px solid transparent;
    cursor: pointer;
}

.btn-login-secondary--cyan {
    background: color-mix(in srgb, var(--brand-500) 12%, #fff);
    border-color: color-mix(in srgb, var(--brand-500) 30%, #fff);
    color: var(--brand-800);
}

.btn-login-secondary--cyan:hover {
    background: color-mix(in srgb, var(--brand-500) 20%, #fff);
    color: var(--brand-900);
    text-decoration: none;
}

.btn-login-secondary--ghost {
    background: var(--sm-surface, #fff);
    border-color: var(--sm-border, #dbe7ea);
    color: var(--sm-text-soft, #566268);
}

.btn-login-secondary--ghost:hover {
    background: var(--sm-surface-2, #f4f8f9);
    color: var(--sm-text, #1c2b30);
    text-decoration: none;
}

.login-info {
    /* bloco de fluxo (não flex): ícone + texto + link ficam no mesmo parágrafo
       e o telefone não vira coluna estreita à direita */
    display: block;
    background: color-mix(in srgb, var(--brand-500) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--brand-500) 28%, #fff);
    color: var(--brand-900, #0b5c6b);
    font-size: 13.5px;
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    line-height: 1.5;
}

.login-info::after {
    content: "";
    display: table;
    clear: both;
}

.login-info > i:first-child {
    float: left;
    margin: 2px 10px 0 0;
}

.login-info a {
    white-space: nowrap;
}

/* Formulários públicos largos (solicitações) */
.login-page--wide .login-split {
    grid-template-columns: minmax(280px, 34%) 1fr;
}

.login-page--wide .login-card {
    max-width: 920px;
    padding: 32px 28px;
}

/* Totens / controle de acesso / painéis densos */
.login-page--panel .login-split {
    grid-template-columns: minmax(240px, 28%) 1fr;
}

.login-page--panel .login-form-panel {
    place-items: start center;
    padding: 24px 16px 40px;
}

.login-page--panel .login-card {
    max-width: 1100px;
    padding: 28px 24px;
}

.login-page--wide .login-card .form-control,
.login-page--panel .login-card .form-control {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--sm-text, #1c2b30);
    background: var(--sm-surface, #fff);
    border: 1.5px solid var(--sm-border, #dbe7ea);
    border-radius: 10px;
    box-shadow: none;
}

.login-page--wide .login-card .form-control:focus,
.login-page--panel .login-card .form-control:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(18, 175, 200, .18);
}

.login-page--wide .login-card label,
.login-page--panel .login-card label {
    font-size: 13px;
    font-weight: 600;
    color: var(--sm-text, #1c2b30);
}

.login-page--wide .login-card .btn,
.login-page--panel .login-card .btn {
    border-radius: 10px;
    font-weight: 600;
    min-height: 44px;
}

.login-page--wide .login-card .btn-primary,
.login-page--panel .login-card .btn-primary,
.login-page--wide .login-card .btn-success,
.login-page--panel .login-card .btn-success {
    background: var(--pm-gradient-primary, linear-gradient(135deg, var(--brand-600), var(--brand-500)));
    border-color: transparent;
}

.login-public-clock {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: .04em;
    color: var(--brand-700, #0f6b7a);
    font-variant-numeric: tabular-nums;
}

.login-public-kicker {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--sm-text, #1c2b30);
}

.login-public-meta {
    margin: 0 0 18px;
    font-size: .95rem;
    color: var(--sm-text-soft, #566268);
}

@media (max-width: 860px) {
    .login-split { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-card { max-width: 100%; }
    .login-page--wide .login-split,
    .login-page--panel .login-split {
        grid-template-columns: 1fr;
    }
}

/* Dark mode */
html[data-theme="dark"] .login-form-panel {
    background: var(--sm-bg);
}

html[data-theme="dark"] .login-card {
    background: var(--sm-surface);
    border-color: var(--sm-border);
    box-shadow: var(--sm-shadow);
}

html[data-theme="dark"] .login-card h2,
html[data-theme="dark"] .login-card label.field-label {
    color: var(--sm-text);
}

html[data-theme="dark"] .login-hint,
html[data-theme="dark"] .login-remember,
html[data-theme="dark"] .login-divider {
    color: var(--sm-text-soft);
}

html[data-theme="dark"] .login-field {
    background: var(--sm-surface-2);
    border-color: var(--sm-border);
}

html[data-theme="dark"] .login-field input {
    background: transparent;
    color: var(--sm-text);
}

html[data-theme="dark"] .login-field__prefix,
html[data-theme="dark"] .password-toggle {
    color: var(--sm-text-soft);
}

html[data-theme="dark"] .login-error {
    background: rgba(220, 38, 38, .12);
    border-color: rgba(220, 38, 38, .28);
    color: #fca5a5;
}

html[data-theme="dark"] .btn-login-secondary--cyan {
    background: rgba(18, 175, 200, .12);
    border-color: rgba(18, 175, 200, .28);
    color: var(--brand-300);
}

html[data-theme="dark"] .btn-login-secondary--ghost {
    background: var(--sm-surface-2);
    border-color: var(--sm-border);
    color: var(--sm-text-soft);
}

html[data-theme="dark"] .btn-login-secondary--ghost:hover {
    background: var(--sm-surface);
    color: var(--sm-text);
}

html[data-theme="dark"] .login-divider::before,
html[data-theme="dark"] .login-divider::after {
    background: var(--sm-border);
}

html[data-theme="dark"] .login-info {
    background: rgba(18, 175, 200, .12);
    border-color: rgba(18, 175, 200, .28);
    color: var(--brand-300);
}

/* Autopreenchimento do navegador — mantém cores do tema nos inputs */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--sm-surface, #fff) inset !important;
    box-shadow: 0 0 0 1000px var(--sm-surface, #fff) inset !important;
    -webkit-text-fill-color: var(--sm-text, #1c2b30) !important;
    caret-color: var(--sm-text, #1c2b30);
    border-radius: 0 8px 8px 0;
    transition: background-color 99999s ease-in-out 0s;
}

html[data-theme="dark"] .login-field input:-webkit-autofill,
html[data-theme="dark"] .login-field input:-webkit-autofill:hover,
html[data-theme="dark"] .login-field input:-webkit-autofill:focus,
html[data-theme="dark"] .login-field input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--sm-surface-2) inset !important;
    box-shadow: 0 0 0 1000px var(--sm-surface-2) inset !important;
    -webkit-text-fill-color: var(--sm-text) !important;
    caret-color: var(--sm-text);
    border-radius: 0 8px 8px 0;
}

.login-field.login-field--password input:-webkit-autofill,
.login-field.login-field--password input:-webkit-autofill:hover,
.login-field.login-field--password input:-webkit-autofill:focus,
.login-field.login-field--password input:-webkit-autofill:active,
html[data-theme="dark"] .login-field.login-field--password input:-webkit-autofill,
html[data-theme="dark"] .login-field.login-field--password input:-webkit-autofill:hover,
html[data-theme="dark"] .login-field.login-field--password input:-webkit-autofill:focus,
html[data-theme="dark"] .login-field.login-field--password input:-webkit-autofill:active {
    border-radius: 0;
}
