/* --- RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* --- BODY --- */
body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(120deg, #0f2027 0%, #2c5364 100%);
    min-height: 100vh;
    padding: 30px;
    color: #222;
}

/* --- GLASS CONTAINER --- */
.container, .form-table-container, .index-container {
    max-width: 700px;
    margin: 0 auto;
    background: rgba(255,255,255,0.18);
    border-radius: 22px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.24);
    overflow: hidden;
    padding: 40px;
    position: relative;
}

/* --- HEADER --- */
.header, .form-table-header, .index-header {
    background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
    color: #fff;
    padding: 36px;
    text-align: center;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 4px 24px rgba(221,36,118,0.12);
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
}

.header h2, .form-table-header h2, .index-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* --- FORM CONTENT --- */
.form-content {
    padding: 36px;
}

/* --- FORM GROUP --- */
.form-group {
    margin-bottom: 28px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    color: #222;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 1px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 17px;
    background: rgba(255,255,255,0.7);
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-shadow: 0 2px 8px rgba(44,83,100,0.08);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff512f;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,81,47,0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 110px;
}

/* --- CHECKBOX --- */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-group input[type="checkbox"] {
    accent-color: #ff512f;
    width: 18px;
    height: 18px;
}

.checkbox-group label {
    font-size: 15px;
    color: #444;
}

/* --- BUTTONS --- */
.btn, .btn-table, .btn-index {
    background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
    color: #fff;
    padding: 16px 44px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 100%;
    box-shadow: 0 4px 16px rgba(221,36,118,0.10);
    position: relative;
    overflow: hidden;
}

.btn:hover, .btn-table:hover, .btn-index:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 32px rgba(255,81,47,0.18);
    background: linear-gradient(90deg, #dd2476 0%, #ff512f 100%);
}

.btn:active, .btn-table:active, .btn-index:active {
    transform: translateY(0) scale(0.98);
}

.btn-secondary, .btn-table-secondary {
    background: linear-gradient(90deg, #232526 0%, #414345 100%);
    color: #fff;
    border-radius: 12px;
    font-weight: 700;
    margin-top: 12px;
}

.btn-secondary:hover, .btn-table-secondary:hover {
    background: linear-gradient(90deg, #414345 0%, #232526 100%);
    box-shadow: 0 8px 24px rgba(44,83,100,0.18);
}

/* --- BUTTON GROUP --- */
.btn-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* --- ERROR & SUCCESS --- */
.form-group.error input,
.form-group.error textarea {
    border-color: #e74c3c;
    background-color: #fff0f0;
}

.error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 6px;
    font-weight: 600;
}

.form-group.focused label {
    color: #ff512f;
}

/* --- PASSWORD STRENGTH --- */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    height: 6px;
    border-radius: 3px;
    transition: all 0.3s;
    margin-bottom: 7px;
}

.strength-weak { background: #e74c3c; width: 25%; }
.strength-fair { background: #f39c12; width: 50%; }
.strength-good { background: #3498db; width: 75%; }
.strength-strong { background: #27ae60; width: 100%; }

.strength-text {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.strength-text.weak { color: #e74c3c; }
.strength-text.fair { color: #f39c12; }
.strength-text.good { color: #3498db; }
.strength-text.strong { color: #27ae60; }

/* --- GLOBAL MESSAGES --- */
.success-message,
.error-message-global {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    padding: 22px 32px;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    animation: slideIn 0.3s ease;
    font-weight: 700;
    font-size: 16px;
}

.success-message {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    color: #fff;
}

.error-message-global {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    color: #fff;
}

.success-content h3,
.error-content h3 {
    margin: 0 0 7px 0;
    font-size: 18px;
}

.success-content p,
.error-content p {
    margin: 0;
    font-size: 15px;
}

/* --- LOADING SPINNER --- */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- FORM TABLE --- */
.form-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 24px 0;
    background: rgba(255,255,255,0.6);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(44,83,100,0.10);
}

.form-table td {
    padding: 18px;
    border-bottom: 1px solid #e1e5e9;
}

.form-table td:first-child {
    background-color: #f8f9fa;
    font-weight: 700;
    color: #222;
    width: 32%;
    border-right: 1px solid #e1e5e9;
}

.form-table input,
.form-table select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255,255,255,0.8);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-table input:focus,
.form-table select:focus {
    border-color: #ff512f;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255,81,47,0.10);
}

/* --- FORM CARD --- */
.form-card {
    background: rgba(255,255,255,0.22);
    border: 2px solid #e1e5e9;
    border-radius: 18px;
    padding: 32px;
    text-align: center;
    transition: all 0.3s;
    box-shadow: 0 4px 18px rgba(44,83,100,0.10);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
}

.form-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 16px 40px rgba(255,81,47,0.12);
    border-color: #ff512f;
}

.form-card h3 {
    margin: 0 0 18px 0;
    color: #222;
    font-size: 24px;
    font-weight: 700;
}

.form-card p {
    color: #555;
    margin-bottom: 28px;
    line-height: 1.7;
    font-size: 15px;
}

/* --- INDEX BUTTON COLORS --- */
.btn-index.btn-empleados { background: linear-gradient(90deg, #27ae60 0%, #2ecc71 100%); }
.btn-index.btn-eps { background: linear-gradient(90deg, #3498db 0%, #2980b9 100%); }
.btn-index.btn-instructores { background: linear-gradient(90deg, #f39c12 0%, #e67e22 100%); }
.btn-index.btn-usuarios { background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%); }

.btn-index.btn-empleados:hover { box-shadow: 0 8px 32px rgba(39,174,96,0.18); }
.btn-index.btn-eps:hover { box-shadow: 0 8px 32px rgba(52,152,219,0.18); }
.btn-index.btn-instructores:hover { box-shadow: 0 8px 32px rgba(243,156,18,0.18); }
.btn-index.btn-usuarios:hover { box-shadow: 0 8px 32px rgba(231,76,60,0.18); }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .container, .form-table-container, .index-container {
        padding: 18px;
        border-radius: 14px;
    }
    .header, .form-table-header, .index-header {
        padding: 18px;
        font-size: 1.2rem;
    }
    .form-content, .form-card {
        padding: 16px;
    }
    .form-card h3 { font-size: 18px; }
    .btn, .btn-table, .btn-index { padding: 12px 18px; font-size: 15px; }
    .success-message, .error-message-global { right: 8px; left: 8px; top: 8px; padding: 12px 18px; font-size: 14px; }
    .form-table td { padding: 10px; }
}

/* --- UNIQUE ANIMATION --- */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}
.header, .form-table-header, .index-header {
    background-size: 200% 200%;
    animation: gradientMove 4s linear infinite alternate;
}
