/* =============================================================
   BLUESYS — Auth Pages Modern Design
   Usado em: login.php, registo_user.php, recover_password.php
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

html, body {
    margin: 0; padding: 0;
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #F1F5F9;
}

/* ── Layout ──────────────────────────────────────────────── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Painel de Marca (esquerda) ──────────────────────────── */
.auth-brand {
    width: 42%;
    background: linear-gradient(155deg, #111E36 0%, #162B4D 45%, #1E3A63 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: rgba(37,99,235,0.12);
    top: -130px; right: -130px;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 280px; height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    bottom: -80px; left: -80px;
    pointer-events: none;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 340px;
}

.auth-brand-logo-wrap {
    width: 72px; height: 72px;
    border-radius: 20px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.14);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
    padding: 12px;
}

.auth-brand-logo-wrap img {
    width: 100%; height: 100%;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.auth-brand h1 {
    color: #fff;
    font-size: 1.6rem; font-weight: 800;
    margin: 0 0 0.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.auth-brand-sub {
    color: rgba(255,255,255,0.55);
    font-size: 0.83rem;
    margin: 0 0 2.5rem;
    line-height: 1.6;
}

.auth-brand-features {
    list-style: none; padding: 0; margin: 0;
    width: 100%;
}

.auth-brand-features li {
    color: rgba(255,255,255,0.75);
    font-size: 0.82rem;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 0.75rem;
    text-align: left;
}

.auth-brand-features li .feat-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: #F97316;
}

.auth-brand-footer {
    margin-top: 3rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.73rem;
}

/* ── Painel do Formulário (direita) ──────────────────────── */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    background: #F1F5F9;
    overflow-y: auto;
}

.auth-form-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    padding: 2.25rem 2rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
}

.auth-form-logo-mobile {
    display: none;
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-form-logo-mobile img { height: 38px; }

.auth-form-heading {
    margin-bottom: 1.5rem;
}

.auth-form-heading h2 {
    font-size: 1.3rem; font-weight: 700;
    color: #1E293B; margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}

.auth-form-heading p {
    font-size: 0.855rem; color: #64748B; margin: 0;
}

/* ── Campos ──────────────────────────────────────────────── */
.auth-field {
    margin-bottom: 1rem;
}

.auth-field label {
    display: block;
    font-size: 0.78rem; font-weight: 600;
    color: #475569; margin-bottom: 5px;
    letter-spacing: 0.01em;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-icon {
    position: absolute; left: 11px; top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    pointer-events: none;
    display: flex; align-items: center;
}

.auth-input-icon svg,
.auth-input-icon i {
    width: 15px; height: 15px;
    font-size: 15px;
}

.auth-input-wrap input {
    width: 100%;
    padding: 0.62rem 0.875rem 0.62rem 2.25rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #1E293B;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input-wrap select {
    width: 100%;
    padding: 0.62rem 2rem 0.62rem 2.25rem;
    border: 1.5px solid #E2E8F0;
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #1E293B;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 0.75rem center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input-wrap input:focus,
.auth-input-wrap select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}

.auth-input-wrap input::placeholder { color: #CBD5E1; }

.auth-input-wrap select option[disabled] { color: #94A3B8; }

/* Dois campos em linha */
.auth-row {
    display: flex; gap: 10px;
}
.auth-row .auth-field { flex: 1; min-width: 0; }

/* ── Links e acções ──────────────────────────────────────── */
.auth-link-row {
    display: flex;
    justify-content: flex-end;
    margin: -0.25rem 0 0.75rem;
}

.auth-link {
    font-size: 0.78rem; color: #2563EB; font-weight: 500;
    text-decoration: none;
    transition: color 0.12s;
}
.auth-link:hover { color: #1D4ED8; text-decoration: underline; }

/* ── Botão principal ─────────────────────────────────────── */
.auth-btn {
    display: block; width: 100%;
    padding: 0.72rem 1rem;
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
    color: #fff;
    border: none; border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37,99,235,0.28);
    transition: all 0.15s ease;
    margin-top: 0.5rem;
    letter-spacing: 0.01em;
}
.auth-btn:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37,99,235,0.38);
    color: #fff;
}
.auth-btn:active { transform: translateY(0); }

/* ── Botão outline (voltar) ──────────────────────────────── */
.auth-btn-outline {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0.62rem 1.1rem;
    background: transparent;
    color: #2563EB;
    border: 1.5px solid #BFDBFE;
    border-radius: 9px;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.auth-btn-outline:hover {
    background: #EFF6FF; border-color: #2563EB;
    color: #1D4ED8;
}

/* Linha botões recover */
.auth-btn-row {
    display: flex; gap: 10px; align-items: center; justify-content: flex-end;
    margin-top: 0.5rem;
}
.auth-btn-row .auth-btn { flex: 0 0 auto; width: auto; padding: 0.62rem 1.5rem; }

/* ── Divisor / rodapé form ───────────────────────────────── */
.auth-footer-link {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.835rem; color: #94A3B8;
}
.auth-footer-link a {
    color: #2563EB; font-weight: 600; text-decoration: none;
}
.auth-footer-link a:hover { text-decoration: underline; }

/* ── Alertas ─────────────────────────────────────────────── */
.auth-alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 0.75rem 1rem;
    border-radius: 9px;
    font-size: 0.845rem;
    margin-bottom: 1.1rem;
    border-left: 3.5px solid;
    line-height: 1.5;
}
.auth-alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.auth-alert-success {
    background: #ECFDF5; border-left-color: #10B981; color: #065F46;
}
.auth-alert-danger {
    background: #FEF2F2; border-left-color: #EF4444; color: #991B1B;
}
.auth-alert-warning {
    background: #FFFBEB; border-left-color: #F59E0B; color: #92400E;
}

/* ── Modal ───────────────────────────────────────────────── */
.auth-modal .modal-content {
    border: none; border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}
.auth-modal .modal-header {
    border-bottom: none; padding: 1.1rem 1.4rem 0.6rem;
}
.auth-modal .modal-header.danger { background: #FEF2F2; }
.auth-modal .modal-header.warning { background: #FFFBEB; }
.auth-modal .modal-header.info { background: #EFF6FF; }
.auth-modal .modal-title { font-weight: 700; font-size: 1rem; color: #1E293B; }
.auth-modal .modal-body { padding: 0.75rem 1.4rem 1rem; font-size: 0.875rem; color: #475569; line-height: 1.6; }
.auth-modal .modal-body a { color: #2563EB; font-weight: 500; }
.auth-modal .modal-footer { border-top: 1px solid #F1F5F9; padding: 0.75rem 1.4rem; }
.auth-modal .modal-footer .btn {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem; font-weight: 600;
    border-radius: 8px; padding: 0.5rem 1.1rem;
}

/* ── Footer fixo ─────────────────────────────────────────── */
.auth-page-footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    text-align: center;
    font-size: 0.73rem; color: #94A3B8;
    padding: 0.6rem;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .auth-brand { width: 38%; }
}

@media (max-width: 768px) {
    .auth-brand { display: none; }
    .auth-form-logo-mobile { display: block; }
    .auth-form-panel { padding: 1.5rem 1rem; align-items: flex-start; padding-top: 2rem; }
    .auth-form-box { padding: 1.75rem 1.5rem; }
    .auth-row { flex-direction: column; gap: 0; }
}

@media (max-width: 480px) {
    .auth-form-box { padding: 1.5rem 1.25rem; border-radius: 12px; }
    .auth-btn-row { flex-direction: column-reverse; }
    .auth-btn-row .auth-btn { width: 100%; }
    .auth-btn-row .auth-btn-outline { width: 100%; justify-content: center; }
}
