/* Andalucía Fuentes Abiertas - Minimal Login Styles */

:root {
    --primary: #1a5f7a;
    --primary-dark: #0d4a5f;
    --secondary: #57c5b6;
    --accent: #159895;
    --bg: #f0f4f8;
    --surface: #ffffff;
    --text: #2d3748;
    --text-muted: #718096;
    --border: #e2e8f0;
    --success: #38a169;
    --error: #e53e3e;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-box {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2.5rem;
}

.logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

h2 {
    font-size: 1.25rem;
    color: var(--text);
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--surface);
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    margin-top: 0.5rem;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    background: transparent;
    border: 2px solid var(--primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

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

.error-message {
    background: #fed7d7;
    color: var(--error);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
}

.login-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Dashboard styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.user-details h2 {
    text-align: left;
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.user-details p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--secondary);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.dashboard-menu h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-menu ul {
    list-style: none;
}

.dashboard-menu li {
    margin-bottom: 0.5rem;
}

.dashboard-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.dashboard-menu a:hover {
    background: #f7fafc;
}

/* Admin section */
.admin-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal h2 {
    margin-bottom: 1.5rem;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    width: auto;
    margin-top: 0;
}

/* Terms modal */
.terms-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Users list */
.users-list {
    list-style: none;
    margin-top: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.user-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-item-info strong {
    font-size: 0.95rem;
}

.user-item-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-item-actions {
    display: flex;
    gap: 0.5rem;
}

.user-item-actions button {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.user-item-actions button:hover {
    background: var(--primary-dark);
}

/* Roles grid */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.role-card {
    padding: 1rem;
    background: #f7fafc;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.role-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.role-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.role-card ul {
    list-style: none;
    font-size: 0.75rem;
}

.role-card ul li {
    padding: 0.2rem 0;
}

/* Permissions list */
.permissions-list {
    list-style: none;
}

.permissions-list li {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.permission-name {
    font-family: monospace;
    background: #edf2f7;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.5rem;
}

.permission-desc {
    color: var(--text-muted);
}

/* Badge variations */
.badge.admin {
    background: #e53e3e;
    color: white;
}

.badge.operator {
    background: var(--secondary);
    color: var(--primary);
}

.badge.active {
    background: #38a169;
    color: white;
}

.badge.inactive {
    background: #718096;
    color: white;
}

.badge.suspended {
    background: #dd6b20;
    color: white;
}
