/**
 * CRM Havok — login (alinhado a assets/css/havok-auth.css — tema tático escuro)
 */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --auth-bg: #1c1c1c;
    --auth-card: #1f1f1f;
    --auth-border: rgba(129, 144, 118, 0.5);
    --auth-text: #c2d0b1;
    --auth-muted: #819076;
    --auth-accent: #a4c26a;
    --auth-accent-hover: #b5cf7d;
    --auth-rule: rgba(129, 144, 118, 0.35);
    --auth-erro-bg: rgba(255, 68, 68, 0.12);
    --auth-erro-border: rgba(255, 120, 120, 0.45);
    --auth-erro-text: #ffc9c9;
    --auth-shadow: 0 0 18px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body.crm-auth-page {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--auth-text);
    background: var(--auth-bg);
    background-image: radial-gradient(ellipse 100% 80% at 50% -20%, rgba(164, 194, 106, 0.08), transparent 50%);
}

.crm-auth-layout {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.crm-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-card);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    box-shadow: var(--auth-shadow);
    overflow: hidden;
}

/* ——— Cabeçalho (logo + título) ——— */
.crm-auth-card__header {
    padding: 2rem 2rem 1.25rem;
    text-align: center;
}

.crm-auth-card__logo {
    display: block;
    margin: 0 auto 1.25rem;
    max-width: min(220px, 75vw);
    height: auto;
    max-height: 100px;
    object-fit: contain;
    filter: saturate(0.95) contrast(1.05);
}

.crm-auth-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.2;
    color: var(--auth-accent);
    text-transform: uppercase;
}

.crm-auth-card__lead {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--auth-muted);
    max-width: 28em;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    text-align: left;
}

.crm-auth-card__lead-icon {
    flex-shrink: 0;
    padding-top: 2px;
}

.crm-icon--lead {
    color: var(--auth-muted);
}

.crm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ——— Divisória ——— */
.crm-auth-rule {
    border: none;
    height: 1px;
    margin: 0;
    background: var(--auth-rule);
}

/* ——— Corpo (formulário) ——— */
.crm-auth-card__body {
    padding: 1.5rem 2rem 1.75rem;
}

.crm-auth-form-title {
    margin: 0 0 0.35rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--auth-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.crm-icon--title {
    color: var(--auth-accent);
    flex-shrink: 0;
}

.crm-auth-form-hint {
    margin: 0 0 1.25rem;
    font-size: 0.8125rem;
    color: var(--auth-muted);
    line-height: 1.45;
}

.crm-auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 1.25rem;
}

.crm-auth-alert--erro {
    color: var(--auth-erro-text);
    background: var(--auth-erro-bg);
    border: 1px solid var(--auth-erro-border);
}

.crm-auth-alert code {
    font-size: 0.8125rem;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.35);
    color: var(--auth-text);
}

.crm-auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.crm-auth-field {
    margin-bottom: 1rem;
}

.crm-auth-field:last-of-type {
    margin-bottom: 1.25rem;
}

.crm-auth-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--auth-text);
}

.crm-icon--label {
    color: var(--auth-muted);
    flex-shrink: 0;
}

.crm-auth-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--auth-text);
    background: #252525;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.crm-auth-input::placeholder {
    color: #5c6b52;
}

.crm-auth-input:hover {
    border-color: rgba(129, 144, 118, 0.65);
}

.crm-auth-input:focus {
    border-color: rgba(164, 194, 106, 0.55);
    box-shadow: 0 0 0 2px rgba(164, 194, 106, 0.15), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.crm-auth-submit {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #0a0a0a;
    background: var(--auth-accent);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        0 6px 14px rgba(0, 0, 0, 0.45);
}

.crm-auth-submit .crm-icon--btn {
    color: #0a0a0a;
}

.crm-auth-submit:hover {
    background: var(--auth-accent-hover);
}

.crm-auth-submit:active {
    transform: scale(0.99);
}

/* ——— Rodapé do cartão ——— */
.crm-auth-card__footer {
    padding: 1rem 2rem 1.5rem;
    text-align: center;
}

.crm-auth-card__footer p {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--auth-muted);
}

@media (max-width: 400px) {
    .crm-auth-card__header,
    .crm-auth-card__body,
    .crm-auth-card__footer {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}
