@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #0066CC;
    --primary-light: #1a88ff;
    --primary-dark: #003d7a;
    --accent: #00d4ff;
    --accent-warm: #ffb800;
    --bg-deep: #002855;
    --card: #ffffff;
    --text: #0a1628;
    --text-muted: #4a5f78;
    --border: #c5d9f0;
    --error: #e53935;
    --success: #00c853;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0, 40, 100, 0.25);
    --shadow-card: 0 4px 20px rgba(0, 61, 122, 0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Outfit', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-deep);
    background-image:
        linear-gradient(160deg, #001a3d 0%, #003d7a 35%, #0066CC 70%, #0088ee 100%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.55;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.03) 40px,
            rgba(255, 255, 255, 0.03) 42px
        );
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* ── Hero ── */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
    padding: 2.5rem 1.25rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 4px solid var(--accent-warm);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(0, 212, 255, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '🏸';
    position: absolute;
    font-size: 8rem;
    opacity: 0.06;
    right: 5%;
    top: 50%;
    transform: translateY(-50%) rotate(-15deg);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 720px;
    margin: 0 auto;
}

.header-logo {
    max-height: 88px;
    max-width: 260px;
    margin-bottom: 1rem;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.hero h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1.15;
}

.hero-sub {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.hero-badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.4rem 1.1rem;
    background: var(--accent-warm);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.85rem;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 4px 0 #cc9200;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.75rem 1rem 3rem;
}

/* ── Cards ── */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 0;
    margin-bottom: 1.25rem;
    border: 2px solid rgba(0, 102, 204, 0.15);
    overflow: hidden;
}

.card-sport .card-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    border-bottom: 3px solid var(--accent-warm);
}

.card-step {
    flex-shrink: 0;
    width: 2.4rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-warm);
    color: var(--primary-dark);
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 10px;
    box-shadow: 0 3px 0 #cc9200;
}

.card-head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    padding: 0;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.card-body {
    padding: 1.25rem 1.25rem 1.5rem;
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid var(--accent);
}

.card-hint {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding: 0.65rem 0.9rem;
    background: #eef6ff;
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Form ── */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

label .required {
    color: var(--error);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    background: #f8fbff;
    color: var(--text);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.2);
    transform: translateY(-1px);
}

input[type="file"] {
    font-size: 0.88rem;
    padding: 0.5rem 0;
    font-weight: 500;
}

/* ── Checkboxes entreno ── */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fbff;
}

.checkbox-item:hover {
    border-color: var(--primary);
    background: #eef6ff;
    transform: translateX(4px);
}

.checkbox-item.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, #e8f4ff 0%, #d6ebff 100%);
    box-shadow: 0 4px 0 var(--primary);
    transform: translateX(4px);
}

.checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    accent-color: var(--primary);
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-item .day-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary-dark);
}

.checkbox-item .day-time {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.checkbox-item.selected .day-name {
    color: var(--primary);
}

/* ── Precios ── */
.price-summary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border-radius: var(--radius-sm);
    padding: 1.1rem 1.25rem;
    margin-top: 1rem;
    color: #fff;
    border: 2px solid var(--accent);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.15);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.price-row.total {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 0.6rem;
    padding-top: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--accent-warm);
}

/* ── Firma ── */
.signature-section {
    margin-top: 0.5rem;
}

.signature-pad-wrapper {
    border: 2px dashed var(--primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
}

.signature-pad-wrapper canvas {
    display: block;
    width: 100%;
    height: 150px;
    touch-action: none;
}

.signature-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0.75rem;
    background: #eef6ff;
    border-top: 2px solid var(--border);
}

/* ── Botones ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:active { transform: translateY(2px); }

.btn-primary {
    background: linear-gradient(180deg, var(--accent-warm) 0%, #e6a500 100%);
    color: var(--primary-dark);
    width: 100%;
    font-size: 1.1rem;
    padding: 1.1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 0 #b8860b, 0 8px 24px rgba(255, 184, 0, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ffc933 0%, var(--accent-warm) 100%);
    box-shadow: 0 4px 0 #b8860b, 0 6px 20px rgba(255, 184, 0, 0.45);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
}

.btn-danger {
    background: var(--error);
    color: #fff;
    box-shadow: 0 3px 0 #b71c1c;
}

.btn-danger:hover { background: #c62828; }

.form-actions {
    margin-top: 0.5rem;
    padding-bottom: 1rem;
}

/* ── Alertas ── */
.alert {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 2px solid transparent;
}

.alert-success {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #66bb6a;
}

.alert-error {
    background: #ffebee;
    color: #b71c1c;
    border-color: #ef5350;
}

.alert-info {
    background: #e3f2fd;
    color: #0d47a1;
    border-color: #42a5f5;
}

/* ── Badge categoría ── */
.badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 800;
    background: var(--primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    box-shadow: 0 3px 0 var(--primary-dark);
}

.hidden { display: none !important; }

/* ── Éxito ── */
.success-card {
    text-align: center;
    padding: 3rem 1.5rem !important;
    border: 3px solid var(--accent-warm);
}

.success-icon {
    width: 5rem;
    height: 5rem;
    background: linear-gradient(135deg, var(--success) 0%, #00e676 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2.5rem;
    color: #fff;
    font-weight: 800;
    box-shadow: 0 6px 0 #009624, 0 8px 24px rgba(0, 200, 83, 0.4);
}

.success-title {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.success-text {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* ── Admin ── */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    border: 2px solid rgba(0, 102, 204, 0.2);
    box-shadow: var(--shadow-card);
}

.admin-header h1 {
    color: var(--primary) !important;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary-dark);
    background: #eef6ff;
    border: 2px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 3px 0 var(--primary-dark);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 2px solid rgba(0, 102, 204, 0.15);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.88rem;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid #eef4fb;
}

th {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

tr:hover td {
    background: #f0f7ff;
}

.table-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.login-container {
    max-width: 420px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.login-container .card {
    padding: 2rem 1.5rem;
    border: 3px solid var(--accent-warm);
}

/* Admin cards need padding when no card-body */
body:not(.page-form) .card:not(.card-sport) {
    padding: 1.5rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }

    .hero { padding: 2rem 1rem 2.5rem; }

    .card-body { padding: 1rem; }

    .card-head { padding: 0.85rem 1rem; }

    .card-step { width: 2rem; height: 2rem; font-size: 0.85rem; }

    .admin-header { flex-direction: column; align-items: flex-start; }

    table { font-size: 0.8rem; }
    th, td { padding: 0.5rem 0.65rem; }
}

@media (max-width: 400px) {
    .container { padding: 1.25rem 0.75rem 2.5rem; }
}
