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

:root {
    --primary-color: #9F2241; /* Guinda Institucional ADIP */
    --primary-hover: #7a1932;
    --primary-light: rgba(159, 34, 65, 0.1);
    --bg-gradient: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.4);
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --success: #27ae60;
    --danger: #e74c3c;
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-main);
    background-attachment: fixed;
}

#app {
    width: 100%;
    max-width: 1200px;
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    overflow: hidden;
    animation: fadeIn 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.card-header-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.card-header-logo img {
    max-width: 100%;
    height: auto;
    max-height: 120px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.card-header-logo-login img {
    max-height: 150px;
    filter: brightness(0) invert(1) drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.card-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.card-header p {
    font-size: 17px;
    font-weight: 300;
    opacity: 0.95;
}

.card-body {
    padding: 50px 40px;
}

/* Forms */
.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    background: rgba(255,255,255,0.9);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: #fff;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(159, 34, 65, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(159, 34, 65, 0.4);
    background: var(--primary-hover);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #219a52;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    animation: slideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.alert-success {
    background: #edf7ed;
    color: #1e4620;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #fdeded;
    color: #5f2120;
    border: 1px solid #f8bbd0;
}

/* Layout Utilities */
.text-center { text-align: center; }
.mt-3 { margin-top: 24px; }

.link-button {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.link-button:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Navbar */
.nav-bar {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    padding: 20px 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--card-border);
}

.nav-bar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-bar-logo img {
    height: 45px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.nav-bar h2 {
    color: var(--text-main);
    margin: 0;
    font-weight: 700;
    font-size: 22px;
}

/* Tabs */
.nav-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 35px;
    background: rgba(255,255,255,0.5);
    padding: 8px;
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.nav-tab {
    padding: 14px 28px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
}

.nav-tab:hover:not(.active) {
    background: rgba(255,255,255,0.8);
    color: var(--text-main);
}

.nav-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* API Key Cards */
.api-key-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.api-key-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(159, 34, 65, 0.12);
}

.api-key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.api-key-header h3 {
    color: var(--text-main);
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.api-key-status {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active { background: #edf7ed; color: #1e4620; }
.status-inactive { background: #fdeded; color: #5f2120; }

.api-key-details p {
    margin: 8px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.api-key-value {
    background: #f8fafc;
    padding: 16px;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    margin: 15px 0;
    border: 1px solid #e2e8f0;
    color: var(--primary-color);
    font-weight: 600;
}

.api-key-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Captcha Demo */
.captcha-demo {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.captcha-image {
    max-width: 100%;
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    margin: 25px auto;
    display: block;
    box-shadow: 0 8px 20px rgba(159, 34, 65, 0.15);
    transition: transform 0.3s ease;
}

.captcha-image:hover {
    transform: scale(1.02);
}

/* Loaders and Empty States */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--primary-color);
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 72px;
    margin-bottom: 24px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUpModal 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpModal {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header h2 {
    color: var(--text-main);
    margin: 0;
    font-weight: 700;
}

/* Users Section */
.user-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 18px;
    transition: all 0.3s;
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.user-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-admin { background: var(--primary-light); color: var(--primary-color); }
.badge-user { background: #f1f5f9; color: #475569; }

/* Loaders */
[v-cloak] { display: none !important; }

#app-loader {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 50px;
}

[v-cloak] + #app-loader { display: flex; }
#app:not([v-cloak]) + #app-loader { display: none; }

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin-bottom: 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-main);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.app-loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    padding: 50px;
}
