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

html {
    background-color: #0a0e13;
}

body {
    font-family: 'Raleway', Arial, sans-serif;
    background: #0a0e13;
    color: #e0e0e0;
    line-height: 1.6;
    --primary-color: #b47b18;
    --primary-light: #d49832;
    --bg-dark-1: #151c22;
    --bg-dark-2: #18212a;
}

/* Login Screen */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0a0e13 0%, #151c22 100%);
}

.login-box {
    background: #1a2129;
    border-radius: 12px;
    padding: 50px 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(180, 123, 24, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 32px;
    color: #d49832;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.login-header p {
    color: #909090;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #bbbbbb;
    font-size: 14px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: #0f1419;
    border: 1px solid #2a3440;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 15px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #b47b18;
    background: #151c22;
}

/* hCaptcha container styling */
.h-captcha {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #b47b18 0%, #d49832 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Outfit', Arial, sans-serif;
    letter-spacing: 1px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(180, 123, 24, 0.4);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.message.success {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #81c784;
}

.message.error {
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #e57373;
}

/* Dashboard */
.dashboard {
    display: none;
    min-height: 100vh;
    background: #0a0e13;
}

.dashboard-header {
    background: linear-gradient(135deg, #1a2129 0%, #151c22 100%);
    padding: 25px 20px;
    border-bottom: 2px solid rgba(180, 123, 24, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.dashboard-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.dashboard-title h1 {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 28px;
    color: #d49832;
    margin-bottom: 5px;
}

.dashboard-title p {
    color: #909090;
    font-size: 14px;
}

.user-info {
    text-align: right;
}

.user-email {
    color: #bbbbbb;
    font-size: 14px;
    margin-bottom: 8px;
}

.btn-logout {
    padding: 10px 24px;
    background: rgba(244, 67, 54, 0.2);
    border: 1px solid rgba(244, 67, 54, 0.5);
    border-radius: 6px;
    color: #e57373;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: rgba(244, 67, 54, 0.3);
}

.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.stat-card {
    background: #1a2129;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid rgba(180, 123, 24, 0.2);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(180, 123, 24, 0.5);
    box-shadow: 0 10px 30px rgba(180, 123, 24, 0.2);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.stat-icon i {
    display: inline-block;
}

.stat-label {
    color: #909090;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #d49832;
    font-family: 'Outfit', Arial, sans-serif;
}

.section {
    background: #1a2129;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(180, 123, 24, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #2a3440;
}

.section-title {
    font-family: 'Outfit', Arial, sans-serif;
    font-size: 24px;
    color: #d49832;
}

.inscription-card {
    background: #0f1419;
    border: 1px solid #2a3440;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.inscription-card:hover {
    border-color: rgba(180, 123, 24, 0.5);
}

.inscription-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.inscription-title {
    font-size: 20px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 8px;
}

.inscription-date {
    color: #909090;
    font-size: 13px;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-completed {
    background: rgba(76, 175, 80, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.5);
    color: #81c784;
}

.status-pending {
    background: rgba(255, 152, 0, 0.2);
    border: 1px solid rgba(255, 152, 0, 0.5);
    color: #ffb74d;
}

.inscription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    color: #909090;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #e0e0e0;
    font-size: 15px;
    font-weight: 500;
}

.modules-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.module-badge {
    background: rgba(180, 123, 24, 0.2);
    border: 1px solid rgba(180, 123, 24, 0.5);
    color: #d49832;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #909090;
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
    color: var(--primary-light);
}

.empty-state-icon i {
    display: inline-block;
}

.empty-state h3 {
    font-size: 20px;
    color: #bbbbbb;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #909090;
}

.spinner {
    border: 3px solid rgba(180, 123, 24, 0.3);
    border-top: 3px solid #d49832;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .dashboard-header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .user-info {
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .inscription-details {
        grid-template-columns: 1fr;
    }
}

/* Dispositivos foldables cerrados (280-320px) */
@media (max-width: 320px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .dashboard-title h1 {
        font-size: 22px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .section {
        padding: 20px 15px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .inscription-card {
        padding: 18px 15px;
    }
    
    .inscription-title {
        font-size: 16px;
    }
    
    .btn-logout {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Pantallas intermedias (tablets, foldables abiertos) */
@media (min-width: 600px) and (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .inscription-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Prevenir barra blanca en cualquier dispositivo */
@media screen {
    html, body, .login-container, .dashboard {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height para móviles */
    }
}
