:root {
    --brand-red: #e02b20;
    --brand-red-dark: #c4251b;
    --brand-overlay: rgba(0, 0, 0, 0.6);
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --error: #dc2626;
    --success: #059669;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--brand-red) 0%, var(--brand-red-dark) 50%, #1a1a1a 100%);
    color: var(--gray-900);
    position: relative;
    overflow-x: hidden;
}

/* Background pattern */
.pattern-overlay {
    position: fixed;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, var(--brand-red) 0%, transparent 35%),
        radial-gradient(circle at 80% 20%, var(--brand-red) 0%, transparent 35%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 35px,
            rgba(255, 255, 255, 0.03) 35px,
            rgba(255, 255, 255, 0.03) 70px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 35px,
            rgba(0, 0, 0, 0.05) 35px,
            rgba(0, 0, 0, 0.05) 70px
        );
    background-color: var(--brand-overlay);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* Layout dos columnas en desktop */
@media (min-width: 992px) {
    .home-layout {
        max-width: 1100px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
        align-items: start;
        padding: 2rem;
    }
    .home-left {
        position: sticky;
        top: 2rem;
    }
    .home-left .header {
        text-align: left;
        margin-bottom: 1.5rem;
    }
    .home-left .motivation {
        margin-bottom: 0;
    }
    .home-right {
        min-width: 0;
    }
    .home-layout .footer {
        grid-column: 1 / -1;
        margin-top: 1rem;
    }
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 0 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tagline {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    margin: 0;
    font-weight: 500;
}

/* Motivation section */
.motivation {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--brand-red);
}

.motivation p {
    margin: 0;
    color: var(--gray-700);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Form card */
.form-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.form-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0 0 0.5rem;
}

.form-intro {
    color: var(--gray-500);
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="email"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(224, 43, 32, 0.15);
}

.form-group input::placeholder {
    color: var(--gray-500);
}

/* Dropzone */
.upload-zone .dropzone {
    border: 2px dashed var(--gray-200);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
}

.upload-zone .dropzone:hover,
.upload-zone .dropzone.dragover {
    border-color: var(--brand-red);
    background: rgba(224, 43, 32, 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--brand-red);
    margin-bottom: 0.75rem;
}

.dropzone-content p {
    margin: 0 0 0.25rem;
    color: var(--gray-700);
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.file-list {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.file-tag .remove-file {
    cursor: pointer;
    color: var(--gray-500);
    font-size: 1.1rem;
    line-height: 1;
}

.file-tag .remove-file:hover {
    color: var(--brand-red);
}

/* Checkboxes */
.checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.checkbox-label input {
    margin-top: 0.2rem;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--brand-red);
}

.checkbox-label a {
    color: var(--brand-red);
    text-decoration: underline;
}

.checkbox-label a:hover {
    color: var(--brand-red-dark);
}

/* Messages */
.form-errors,
.form-success {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.form-errors {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

.form-success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-dark));
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 14px rgba(224, 43, 32, 0.4);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(224, 43, 32, 0.5);
}

.btn-submit:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.btn-submit.is-loading .btn-text {
    display: none;
}

.btn-submit.is-loading .btn-loading {
    display: inline-flex;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 2rem;
}

.admin-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.admin-link:hover {
    color: var(--white);
    text-decoration: underline;
}

/* Admin styles - fondo neutro, acentos rojos sutiles */
.admin-page {
    min-height: 100vh;
    background: var(--gray-100);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--white);
    color: var(--gray-900);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom: 3px solid var(--brand-red);
}

.admin-header h1 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--gray-900);
}

.admin-header .logo-small {
    height: 40px;
}

.admin-nav a {
    color: var(--gray-700);
    text-decoration: none;
    margin-left: 1.5rem;
}

.admin-nav a:hover {
    color: var(--brand-red);
}

.login-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.login-card h2 {
    margin: 0 0 1.5rem;
    color: var(--gray-900);
}

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

.login-card .btn-submit {
    margin-top: 0.5rem;
}

/* Admin dashboard */
.admin-main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-main h2 {
    color: var(--gray-900);
    margin: 0 0 1.5rem;
    font-size: 1.25rem;
}

.admin-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.admin-toolbar input,
.admin-toolbar select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.9rem;
}

.admin-toolbar input[type="search"] {
    min-width: 220px;
}

.admin-filter-deleted {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray-700);
    cursor: pointer;
}

.admin-table .btn-delete {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    background: transparent;
    color: var(--error);
    border: 1px solid #fecaca;
    border-radius: 6px;
    cursor: pointer;
}

.admin-table .btn-delete:hover {
    background: #fef2f2;
    border-color: var(--error);
    color: var(--error);
}

.admin-table-wrap {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 1rem;
    background: var(--gray-50);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
    color: var(--gray-700);
}

.admin-table tbody tr:hover {
    background: var(--gray-50);
}

.admin-table .photo-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.admin-table .photo-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.admin-table .photo-thumb:hover {
    border-color: var(--brand-red);
}

.admin-table .photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image viewer modal */
.img-viewer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.img-viewer-overlay.is-open {
    display: flex;
}

.img-viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.img-viewer-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.img-viewer-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: var(--white);
    color: var(--gray-900);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-viewer-close:hover {
    background: var(--gray-200);
}

.img-viewer-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.img-viewer-nav button {
    padding: 0.5rem 1rem;
    background: var(--white);
    color: var(--gray-900);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.img-viewer-nav button:hover {
    background: var(--brand-red);
    color: var(--white);
}

.img-viewer-counter {
    color: var(--white);
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-card {
        padding: 1.5rem;
    }

    .container {
        padding: 1.5rem 1rem;
    }
}
