* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #a1aa8b;
    --primary-dark: #8a9475;
    --primary-darker: #6d7a5c;
    --primary-light: #b8c0a6;
    --primary-lighter: #d1d8c2;
    --primary-gradient: linear-gradient(135deg, #a1aa8b 0%, #c4cbb5 100%);
    --primary-bg: rgba(161, 170, 139, 0.1);
    --primary-shadow: rgba(161, 170, 139, 0.3);

    --white: #FFFFFF;
    --gray-50: #F9FAF8;
    --gray-100: #F3F5F0;
    --gray-200: #E5E8E0;
    --gray-300: #D1D5CB;
    --gray-400: #9CA397;
    --gray-500: #6B7263;
    --gray-600: #4B5245;
    --gray-700: #374132;
    --gray-800: #1F2A1A;
    --gray-900: #0F1A0A;

    --bg-primary: var(--gray-900);
    --bg-secondary: var(--white);
    --bg-tertiary: var(--gray-100);
    --text-primary: var(--gray-800);
    --text-secondary: var(--gray-500);
    --text-muted: var(--gray-400);
    --border-color: var(--gray-200);
    --input-bg: var(--white);
    --input-border: var(--gray-300);

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --danger: #ef4444;
}

html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    background: linear-gradient(135deg, rgba(15, 26, 10, 0.95) 0%, rgba(161, 170, 139, 0.85) 50%, rgba(106, 124, 84, 0.75) 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-2xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    border: 1px solid rgba(161, 170, 139, 0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.logo-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.logo-image-admin {
    width: 300px;
    height: auto;
    display: block;
    filter: brightness(0) invert(0);
}

.login-header h1 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 700;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-group label i {
    margin-right: 8px;
    color: var(--primary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--input-border);
    border-radius: var(--radius-lg);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-bg);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.btn-login {
    width: 100%;
    padding: 14px;
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--primary-gradient);
    box-shadow: 0 4px 20px var(--primary-shadow);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-25deg);
    transition: left 0.6s ease;
}

.btn-login:hover::before {
    left: 150%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px var(--primary-shadow);
}

.btn-login:active {
    transform: scale(0.98);
}

.loading-spinner-login {
    display: none;
    text-align: center;
    margin-top: 15px;
    color: var(--text-secondary);
}

.loading-spinner-login i {
    animation: spin 1s linear infinite;
    color: var(--primary);
    margin-right: 8px;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer a {
    text-decoration: none;
    font-weight: 500;
    color: var(--primary);
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.login-footer a i {
    margin-right: 6px;
}

.field-error {
    display: block;
    font-size: 12px;
    color: var(--danger);
    margin-top: 6px;
}

.field-error i {
    margin-right: 4px;
}

/* ========================================
   CUSTOM MODAL - Estilo consistente com o tema
   ======================================== */

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal {
    background: var(--bg-secondary, #ffffff);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(161, 170, 139, 0.15);
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

.custom-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.8rem;
    color: var(--primary);
}

.custom-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary, #1f2a1a);
    margin-bottom: 0.5rem;
}

.custom-modal-message {
    font-size: 0.95rem;
    color: var(--text-secondary, #4b5245);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.custom-modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.custom-modal-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.custom-modal-btn.cancel {
    background: var(--bg-tertiary, #f3f5f0);
    color: var(--text-secondary, #4b5245);
    border: 1px solid var(--border-color, #e5e8e0);
}

.custom-modal-btn.cancel:hover {
    background: var(--gray-200, #e5e8e0);
    transform: translateY(-2px);
}

.custom-modal-btn.confirm {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-shadow);
}

.custom-modal-btn.confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--primary-shadow);
}

.custom-modal-btn.confirm:active {
    transform: scale(0.97);
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px;
        border-radius: var(--radius-xl);
    }

    .logo-icon {
        margin-bottom: 10px;
    }

    .logo-image-admin {
        width: 250px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-header p {
        font-size: 13px;
    }

    .form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-login {
        padding: 12px;
        font-size: 15px;
    }

    .custom-modal {
        padding: 1.5rem 1.5rem;
        border-radius: 20px;
    }

    .custom-modal-icon {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .custom-modal-title {
        font-size: 1.1rem;
    }

    .custom-modal-message {
        font-size: 0.85rem;
    }

    .custom-modal-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 20px 16px;
    }

    .logo-image-admin {
        width: 200px;
    }

    .login-header h1 {
        font-size: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-wrapper {
        animation: none;
    }

    .btn-login:hover {
        transform: none;
    }

    .custom-modal-overlay,
    .custom-modal {
        transition: none !important;
    }

    .custom-modal-btn {
        transition: none !important;
    }

    .custom-modal-btn:hover {
        transform: none !important;
    }
}