:root {
    --primary-color: #0b7a5f;
    --primary-hover: #096b52;
    --bg-color: #ffffff;
    --text-primary: #202123;
    --text-secondary: #565869;
    --border-color: #e5e5e5;
    --card-bg: #ffffff;
    --shadow-light: rgba(0,0,0,.05);
    --shadow-medium: rgba(0,0,0,.1);
}

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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0b7a5f 0%, #096b52 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme {
    --primary-color: #0b7a5f;
    --primary-hover: #096b52;
    --bg-color: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --card-bg: #2d2d2d;
    --shadow-light: rgba(0,0,0,.2);
    --shadow-medium: rgba(0,0,0,.3);
}

.auth-container {
    width: 100%;
    max-width: 450px;
    margin: 20px;
}

.auth-card {
    background-color: var(--card-bg);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.auth-logo {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.auth-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.2);
}

.form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-group input[type="checkbox"]:hover {
    transform: scale(1.05);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.2s;
    margin-bottom: 20px;
}

.auth-btn:hover {
    background-color: var(--primary-hover);
}

.auth-links {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    display: none;
}

.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
    box-shadow: 0 2px 10px var(--shadow-light);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

#passkey-toggle {
    right: 78px;
    color: var(--text-secondary, #888);
}

/* ===== Modal de chave de acesso (passkey) ===== */
.passkey-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.passkey-overlay[hidden] {
    display: none !important;
}

.passkey-modal {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e5e5e5);
    border-radius: 16px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.passkey-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(16, 163, 127, 0.12);
    color: #0b7a5f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.passkey-modal-title {
    font-size: 1.35rem;
    margin: 0 0 6px;
    color: var(--text-primary, #202123);
}

.passkey-modal-desc {
    margin: 0 0 20px;
    font-size: 0.9rem;
    color: var(--text-secondary, #888);
}

.passkey-modal .form-group {
    text-align: left;
}

.passkey-cancel {
    margin-top: 14px;
    background: none;
    border: none;
    color: var(--text-secondary, #888);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.passkey-cancel:hover {
    color: var(--text-primary, #202123);
}

@media (max-width: 480px) {
    .auth-card { padding: 30px 20px; }
    .auth-title { font-size: 1.6rem; }
}
