/* CSS Reset & Variáveis de Design */
:root {
    --primary: #10b981; /* Verde esmeralda (Saúde/Veterinária) */
    --primary-hover: #059669;
    --primary-light: #d1fae5;
    --background: #0f172a; /* Slate escuro */
    --surface: #1e293b;
    --surface-overlay: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --font: 'Outfit', 'Inter', system-ui, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font);
    background: radial-gradient(circle at top right, #1e1b4b, var(--background));
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Background decorativo (efeito premium de luzes) */
.bg-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

/* Botão Central Principal */
.main-container {
    position: relative;
    z-index: 1;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #06b6d4 100%);
    color: #ffffff;
    border: none;
    padding: 1.25rem 2.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4), 0 8px 10px -6px rgba(16, 185, 129, 0.4);
    transition: var(--transition);
    outline: none;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 35px -5px rgba(16, 185, 129, 0.6), 0 10px 15px -6px rgba(16, 185, 129, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.6);
    outline-offset: 4px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 999;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 95%;
    max-width: 560px;
    padding: 1.5rem 2rem; /* Reduzido para caber na tela */
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header-centralizado {
    text-align: center;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}

.modal-title {
    font-size: 1.4rem; /* Tamanho compacto */
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: var(--text);
    background-color: var(--border);
}

.btn-close:focus-visible {
    outline: 2px solid var(--primary);
}

/* Formulário e Inputs */
.form-group {
    margin-bottom: 0.75rem; /* Margem reduzida */
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: #cbd5e1;
}

.input-container {
    position: relative;
}

input {
    width: 100%;
    padding: 0.6rem 0.9rem; /* Padding interno menor */
    background: #0f172a;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: var(--transition);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

input::placeholder {
    color: #475569;
}

/* Força da Senha */
.password-strength-container {
    margin-top: 0.3rem;
}

.strength-bar-bg {
    height: 4px;
    margin-bottom: 0.2rem;
}

.strength-bar-fill {
    height: 100%;
    width: 0;
    transition: var(--transition);
}

.strength-text {
    font-size: 0.7rem;
}

/* Feedbacks e Alertas */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    display: none;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    background-color: var(--error-bg);
    border: 1px solid var(--error);
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-success {
    background-color: var(--success-bg);
    border: 1px solid var(--success);
    color: #a7f3d0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Botão Submit do Form */
.form-submit {
    margin-top: 1rem;
}
.btn-submit {
    padding: 0.85rem;
    font-size: 1rem;
    border-radius: 10px;
}

.btn-submit:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner de Carregamento */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Estilo da Logo centralizada */
.brand-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.modal-logo {
    max-width: 130px; /* Tamanho otimizado */
    height: auto;
    object-fit: contain;
}

/* Janela/Toast Pop-up de Alerta Flutuante */
.toast-alert {
    position: relative;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.toast-alert.toast-error {
    display: flex;
    background-color: #2a1215;
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.toast-alert.toast-success {
    display: flex;
    background-color: #062d1f;
    border: 1px solid #10b981;
    color: #a7f3d0;
}

.toast-icon {
    font-size: 1.1rem;
}

.toast-message {
    flex-grow: 1;
    font-weight: 500;
}

.toast-close {
    background: transparent;
    border: none;
    color: currentColor;
    font-size: 1.25rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 🔒 Alinhamento Lado a Lado da LGPD */
.lgpd-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.25rem 0 0.75rem 0;
}

.lgpd-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
}

.lgpd-container label {
    margin-bottom: 0;
    font-size: 0.8rem;
    color: #cbd5e1;
    cursor: pointer;
}

.lgpd-container a {
    color: #06b6d4;
    text-decoration: underline;
}

.lgpd-container a:hover {
    color: var(--primary);
}

/* 🎯 Centralização do Botão de Cadastro */
.form-submit {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
}

.form-submit .btn-submit {
    width: 100%;
    max-width: 320px; /* Mantém um tamanho harmonioso centralizado */
    justify-content: center;
}

/* Card de Termos / Privacidade */
.modal-termos-content {
    max-width: 600px;
    z-index: 1000;
}

.termos-corpo-scroll {
    max-height: 350px;
    overflow-y: auto;
    padding: 1rem;
    background: #0f172a;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-top: 1rem;
}

/* Customização da barra de rolagem do card de termos */
.termos-corpo-scroll::-webkit-scrollbar {
    width: 6px;
}

.termos-corpo-scroll::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.termos-corpo-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}