/* ============================================
   ESTILOS PRINCIPALES - AMYPE
   Sistema de Afiliación de MIPYMES
   ============================================ */

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

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-bg: #f8f9fa;
    --dark-text: #1f2937;
    --border-color: #e5e7eb;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f3f4f6;
    color: var(--dark-text);
    line-height: 1.6;
}

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: white;
    flex-shrink: 0;
}

.logo img {
    height: 50px;
    width: auto;
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.logo-text p {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
    font-size: 14px;
}

nav a:hover {
    opacity: 0.8;
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 40px 0;
}

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    color: var(--dark-text);
}

/* ============================================
   BIENVENIDA
   ============================================ */

.welcome-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
    border-radius: 10px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.welcome-section h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.welcome-section p {
    font-size: 16px;
    opacity: 0.95;
    margin-bottom: 20px;
}

.welcome-logo {
    margin: 30px 0;
}

.welcome-logo img {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================
   ALERTAS Y AVISOS
   ============================================ */

.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-content h3 {
    margin-bottom: 8px;
    font-size: 16px;
}

.alert-content p {
    font-size: 14px;
    margin: 0;
}

.alert.info {
    background-color: #dbeafe;
    border-color: var(--info-color);
    color: #1e40af;
}

.alert.warning {
    background-color: #fef3c7;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert.danger {
    background-color: #fee2e2;
    border-color: var(--danger-color);
    color: #991b1b;
}

.alert.success {
    background-color: #d1fae5;
    border-color: var(--success-color);
    color: #065f46;
}

.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #25d366;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.whatsapp-link:hover {
    background-color: #20ba58;
}

/* ============================================
   FORMULARIOS
   ============================================ */

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 14px;
}

label .required {
    color: var(--danger-color);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

/* ============================================
   BOTONES
   ============================================ */

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

.btn-secondary:hover {
    background-color: #6a3e8f;
}

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

.btn-success:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #dc2626;
}

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

.btn-warning:hover {
    background-color: #d97706;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-group.center {
    justify-content: center;
}

/* ============================================
   TARJETAS
   ============================================ */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    padding: 25px;
    margin-bottom: 20px;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.card-header h2,
.card-header h3 {
    margin: 0;
    color: var(--dark-text);
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 2px solid var(--border-color);
    padding-top: 15px;
    margin-top: 20px;
}

/* ============================================
   TABLA
   ============================================ */

.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

thead {
    background-color: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 14px;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background-color: #fafafa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* ============================================
   MODAL
   ============================================ */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark-text);
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: #333;
    color: white;
    padding: 30px 0;
    margin-top: 50px;
    text-align: center;
}

footer p {
    margin: 0;
    font-size: 14px;
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE DESIGN - TABLET
   ============================================ */

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    nav ul {
        gap: 15px;
        font-size: 13px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section {
        padding: 25px 0;
    }

    .section-title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .welcome-section {
        padding: 40px 20px;
    }

    .welcome-section h2 {
        font-size: 28px;
    }

    .card {
        padding: 20px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        width: 100%;
    }

    .alert {
        padding: 15px;
        gap: 10px;
    }

    .alert-icon {
        font-size: 20px;
    }

    .alert-content h3 {
        font-size: 14px;
    }

    .alert-content p {
        font-size: 13px;
    }

    th, td {
        padding: 10px;
        font-size: 13px;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* ============================================
   RESPONSIVE DESIGN - MÓVIL
   ============================================ */

@media (max-width: 480px) {
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .logo-text h1 {
        font-size: 20px;
    }

    .logo-text p {
        font-size: 11px;
    }

    nav ul {
        gap: 10px;
        font-size: 12px;
    }

    nav a {
        font-size: 12px;
    }

    .section {
        padding: 20px 0;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .welcome-section {
        padding: 30px 15px;
        margin: 20px 0;
    }

    .welcome-section h2 {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .welcome-section p {
        font-size: 14px;
    }

    .welcome-logo img {
        height: 80px;
    }

    .card {
        padding: 15px;
        margin-bottom: 15px;
    }

    .card-header {
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .card-header h2,
    .card-header h3 {
        font-size: 18px;
    }

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

    label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    select,
    textarea {
        padding: 10px;
        font-size: 13px;
    }

    .btn {
        padding: 10px 15px;
        font-size: 12px;
        width: 100%;
    }

    .btn-group {
        flex-direction: column;
        gap: 8px;
    }

    .btn-group .btn {
        width: 100%;
    }

    .alert {
        padding: 12px;
        gap: 10px;
        margin-bottom: 15px;
    }

    .alert-icon {
        font-size: 18px;
        min-width: 20px;
    }

    .alert-content h3 {
        font-size: 13px;
        margin-bottom: 5px;
    }

    .alert-content p {
        font-size: 12px;
    }

    .alert-content ul {
        font-size: 12px;
        margin-left: 15px;
    }

    th, td {
        padding: 8px;
        font-size: 12px;
    }

    .table-responsive {
        margin-bottom: 15px;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .modal-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .modal-header h2 {
        font-size: 18px;
    }

    .container {
        padding: 0 15px;
    }

    footer {
        padding: 20px 0;
        margin-top: 30px;
    }

    footer p {
        font-size: 12px;
    }
}

/* ============================================
   ADMIN LAYOUT - RESPONSIVE
   ============================================ */

.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: fixed;
    height: 100vh;
    width: 250px;
    overflow-y: auto;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
}

.sidebar-logo {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 20px;
}

.sidebar-logo h2 {
    font-size: 20px;
    margin: 0 0 5px 0;
}

.sidebar-logo p {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

.sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-menu li {
    margin-bottom: 10px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.top-bar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar h1 {
    margin: 0;
    color: var(--dark-text);
    font-size: 24px;
}

/* ============================================
   ADMIN RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 200px 1fr;
    }

    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
        padding: 15px;
    }

    .sidebar-logo h2 {
        font-size: 18px;
    }

    .sidebar-menu a {
        padding: 10px 12px;
        font-size: 13px;
    }

    .top-bar {
        padding: 15px;
    }

    .top-bar h1 {
        font-size: 20px;
    }
}

/* ============================================
   ADMIN RESPONSIVE - MÓVIL
   ============================================ */

@media (max-width: 768px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        width: 100%;
        height: auto;
        max-height: 60vh;
        overflow-y: auto;
        z-index: 999;
        top: 0;
        left: 0;
    }

    .main-content {
        margin-left: 0;
        margin-top: 60px;
        padding: 15px;
    }

    .sidebar-logo {
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .sidebar-menu li {
        margin-bottom: 0;
        flex: 1 1 auto;
        min-width: 100px;
    }

    .sidebar-menu a {
        padding: 8px 10px;
        font-size: 12px;
        text-align: center;
    }

    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-bar h1 {
        font-size: 18px;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        width: 100%;
        height: auto;
        top: 0;
        left: 0;
        z-index: 999;
    }

    .main-content {
        margin-left: 0;
        margin-top: 50px;
        padding: 10px;
    }

    .sidebar-logo {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .sidebar-logo h2 {
        font-size: 16px;
    }

    .sidebar-logo p {
        font-size: 11px;
    }

    .sidebar-menu {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .sidebar-menu a {
        padding: 8px;
        font-size: 11px;
    }

    .top-bar {
        padding: 10px;
        flex-direction: column;
    }

    .top-bar h1 {
        font-size: 16px;
    }
}
