/**
 * Auto360 CRM — Estilos da Página de Login Personalizada
 * Branding RCM Digital + Auto360 Digital, sem identidade WordPress
 *
 * @package Auto360_CRM
 * @since   1.4.0
 */

/* ════════════════════════════════════════════════════════
   VARIÁVEIS E RESET
   ════════════════════════════════════════════════════════ */
:root {
    --a360-primary:       #1a2744;
    --a360-primary-dark:  #0f1929;
    --a360-primary-light: #243460;
    --a360-accent:        #f47c20;
    --a360-accent-light:  #ff9545;
    --a360-text:          #1e293b;
    --a360-text-2:        #334155;
    --a360-muted:         #64748b;
    --a360-border:        #e2e8f0;
    --a360-surface:       #ffffff;
    --a360-bg:            #f8fafc;
    --a360-success:       #10b981;
    --a360-danger:        #ef4444;
    --a360-font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html,
body {
    height: 100%;
    font-family: var(--a360-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--a360-bg);
    color: var(--a360-text);
}

/* ════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL — Dois painéis lado a lado
   ════════════════════════════════════════════════════════ */
.a360-login-page {
    display: grid;
    grid-template-columns: 1fr 480px;
    min-height: 100vh;
}

/* ════════════════════════════════════════════════════════
   PAINEL VISUAL ESQUERDO — Branding e estatísticas
   ════════════════════════════════════════════════════════ */
.a360-login-visual {
    background: linear-gradient(135deg, var(--a360-primary-dark) 0%, var(--a360-primary) 45%, #2d4080 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 56px;
    position: relative;
    overflow: hidden;
}

.a360-login-visual::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -8%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(244, 124, 32, 0.18) 0%, transparent 65%);
    pointer-events: none;
}

.a360-login-visual::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -5%;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 65%);
    pointer-events: none;
}

.a360-login-visual-content {
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.a360-login-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 6px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 28px;
}

.a360-login-visual-content h1 {
    font-size: 40px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.15;
    letter-spacing: -1px;
    margin: 0 0 20px;
}

.a360-login-visual-content p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.7;
    margin-bottom: 40px;
}

.a360-login-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.a360-login-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.a360-login-stat .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--a360-accent);
    letter-spacing: -0.5px;
    line-height: 1;
}

.a360-login-stat .label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    line-height: 1.3;
}

/* ════════════════════════════════════════════════════════
   PAINEL DO FORMULÁRIO — Direita
   ════════════════════════════════════════════════════════ */
.a360-login-form-panel {
    background: var(--a360-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    border-left: 1px solid var(--a360-border);
}

.a360-login-form-wrap {
    width: 100%;
    max-width: 360px;
}

/* Logo */
.a360-login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.a360-login-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--a360-accent) 0%, var(--a360-accent-light) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(244, 124, 32, 0.35);
    flex-shrink: 0;
}

.a360-login-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.a360-login-logo-text strong {
    font-size: 18px;
    font-weight: 800;
    color: var(--a360-text);
    letter-spacing: -0.3px;
}

.a360-login-logo-text span {
    font-size: 12px;
    color: var(--a360-muted);
    font-weight: 400;
    letter-spacing: 0.3px;
}

.a360-login-form-wrap h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--a360-text);
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.a360-login-subtitle {
    font-size: 14px;
    color: var(--a360-muted);
    margin-bottom: 28px;
    line-height: 1.5;
}

/* Alertas */
.a360-login-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.4;
}

.a360-login-alert.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.a360-login-alert.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

/* ════════════════════════════════════════════════════════
   FORMULÁRIO
   ════════════════════════════════════════════════════════ */
.a360-login-form {
    display: flex;
    flex-direction: column;
}

.a360-form-field {
    margin-bottom: 18px;
}

.a360-form-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--a360-text);
    margin-bottom: 8px;
    cursor: default;
}

.a360-forgot-link {
    font-size: 12px;
    font-weight: 400;
    color: var(--a360-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.a360-forgot-link:hover {
    color: var(--a360-accent);
}

.a360-form-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.a360-field-icon {
    position: absolute;
    left: 13px;
    font-size: 14px;
    color: var(--a360-muted);
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.a360-form-field-wrap input[type="email"],
.a360-form-field-wrap input[type="text"],
.a360-form-field-wrap input[type="password"] {
    width: 100%;
    padding: 11px 40px 11px 40px;
    border: 1.5px solid var(--a360-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: var(--a360-font);
    color: var(--a360-text);
    background: var(--a360-bg);
    transition: all 0.15s ease;
    outline: none;
    -webkit-appearance: none;
}

.a360-form-field-wrap input:focus {
    border-color: var(--a360-accent);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(244, 124, 32, 0.12);
}

.a360-toggle-pass {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
    color: var(--a360-muted);
    line-height: 1;
    z-index: 1;
    transition: color 0.15s;
}

.a360-toggle-pass:hover {
    color: var(--a360-text);
}

.a360-form-remember {
    margin-bottom: 22px;
}

.a360-form-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--a360-muted);
    cursor: pointer;
    font-weight: 400;
}

.a360-form-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--a360-accent);
    cursor: pointer;
    flex-shrink: 0;
}

/* Botão de login */
.a360-login-btn {
    width: 100%;
    padding: 13px 20px;
    background: linear-gradient(135deg, var(--a360-accent) 0%, var(--a360-accent-light) 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--a360-font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(244, 124, 32, 0.35);
    letter-spacing: 0.2px;
    -webkit-appearance: none;
}

.a360-login-btn:hover {
    background: linear-gradient(135deg, #d4650f 0%, var(--a360-accent) 100%);
    box-shadow: 0 6px 20px rgba(244, 124, 32, 0.45);
    transform: translateY(-1px);
}

.a360-login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(244, 124, 32, 0.35);
}

/* ════════════════════════════════════════════════════════
   RODAPÉ DO FORMULÁRIO
   ════════════════════════════════════════════════════════ */
.a360-login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--a360-border);
    text-align: center;
    font-size: 12px;
    color: var(--a360-muted);
    line-height: 1.5;
}

.a360-login-footer strong {
    color: var(--a360-primary);
    font-weight: 700;
}

/* ════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .a360-login-page {
        grid-template-columns: 1fr;
    }

    .a360-login-visual {
        display: none;
    }

    .a360-login-form-panel {
        border-left: none;
        padding: 40px 24px;
    }
}

@media (max-width: 480px) {
    .a360-login-form-panel {
        padding: 32px 20px;
    }
}

/* ══════════════════════════════════════════════════════════
   SAFE AREAS E TOUCH TARGETS — iPhone notch / home bar
   ══════════════════════════════════════════════════════════ */

/* ── Viewport dinâmico: evita que a barra de URL do Safari
      crie scroll vertical desnecessário ── */
.a360-login-page {
    min-height: 100svh;
    /* Safe area lateral em landscape (notch / Dynamic Island) */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ── Painel do formulário: espaço para a home bar inferior ── */
.a360-login-form-panel {
    padding-bottom: max(48px, calc(32px + env(safe-area-inset-bottom)));
}

/* ── Botão de login: touch target mínimo de 44px ── */
.a360-login-btn {
    min-height: 48px;
}

/* ── Inputs: font-size mínimo 16px para evitar zoom automático no iOS ── */
@media (max-width: 900px) {
    .a360-form-field-wrap input[type="text"],
    .a360-form-field-wrap input[type="password"] {
        font-size: 16px !important;
        min-height: 48px;
    }

    /* Reafirmar padding com safe area após o override do breakpoint anterior */
    .a360-login-form-panel {
        padding-bottom: max(40px, calc(24px + env(safe-area-inset-bottom)));
    }
}

@media (max-width: 480px) {
    /* Padding lateral com safe area em landscape em ecrãs pequenos */
    .a360-login-form-panel {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(32px, calc(20px + env(safe-area-inset-bottom)));
    }
}

/* ════════════════════════════════════════════════════════
   CAPTCHA — Desafio matemático e reCAPTCHA
   ════════════════════════════════════════════════════════ */
.a360-captcha-field {
    margin-bottom: 18px;
}

.a360-captcha-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--a360-text-2);
    margin-bottom: 8px;
}

.a360-captcha-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--a360-bg);
    border: 1.5px solid var(--a360-border);
    border-radius: 10px;
    padding: 12px 16px;
    transition: border-color 0.2s;
}

.a360-captcha-wrap:focus-within {
    border-color: var(--a360-accent);
    box-shadow: 0 0 0 3px rgba(244, 124, 32, 0.12);
}

.a360-captcha-question {
    font-size: 14px;
    color: var(--a360-text-2);
    white-space: nowrap;
    flex-shrink: 0;
}

.a360-captcha-question strong {
    color: var(--a360-accent);
    font-weight: 700;
}

.a360-captcha-input {
    width: 80px;
    border: none;
    background: transparent;
    font-family: var(--a360-font);
    font-size: 16px;
    font-weight: 700;
    color: var(--a360-text);
    outline: none;
    text-align: center;
    -moz-appearance: textfield;
}

.a360-captcha-input::-webkit-outer-spin-button,
.a360-captcha-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.a360-captcha-input::placeholder {
    color: var(--a360-muted);
    font-weight: 400;
}

/* Aviso reCAPTCHA v3 */
.a360-captcha-notice {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--a360-muted);
    background: var(--a360-bg);
    border: 1px solid var(--a360-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
