:root {
    --bg: #0d0d0d;
    --surface: #161616;
    --surface2: #1e1e1e;
    --border: #2a2a2a;
    --gold: #c9a84c;
    --gold-light: #e8c96e;
    --gold-dim: rgba(201, 168, 76, 0.15);
    --text: #f0ece4;
    --text-muted: #7a7468;
    --error: #e05c5c;
    --success: #5cb88a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -200px;
    left: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(201, 168, 76, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.wrapper {
    width: 100%;
    max-width: 440px;
    animation: fadeUp 0.6s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header {
    text-align: center;
    margin-bottom: 36px;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
}

.header h1 span {
    color: var(--gold);
}

.header p {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    opacity: 0.3;
}

.divider span {
    color: var(--gold);
    font-size: 14px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.6;
}

.field {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
}

input,
select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.92rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}

input::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7468' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

select option {
    background: #1e1e1e;
    color: var(--text);
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Estilos Premium para Input de Fecha */
input[type="date"] {
    color-scheme: dark;
    background: linear-gradient(145deg, #1a1a1a 0%, #141414 100%);
    border: 1px solid rgba(201, 168, 76, 0.3);
    border-radius: 10px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.25s ease;
}

input[type="date"]:hover {
    border-color: var(--gold);
    background: linear-gradient(145deg, #202020 0%, #171717 100%);
    box-shadow: 0 4px 12px rgba(201, 168, 76, 0.1);
}

input[type="date"]:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim), 0 4px 15px rgba(201, 168, 76, 0.2);
    outline: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(72%) sepia(51%) saturate(542%) hue-rotate(6deg) brightness(92%) contrast(88%);
    cursor: pointer;
    opacity: 0.85;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.15);
    background: rgba(201, 168, 76, 0.15);
}

.fecha-selected-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.76rem;
    color: var(--gold-light);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--gold), #b8913a);
    color: #0d0d0d;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.mensaje {
    margin-top: 16px;
    text-align: center;
    font-size: 0.88rem;
    padding: 10px 14px;
    border-radius: 8px;
    display: none;
}

.mensaje.error {
    display: block;
    background: rgba(224, 92, 92, 0.1);
    color: var(--error);
    border: 1px solid rgba(224, 92, 92, 0.25);
}

.mensaje.exito {
    display: block;
    background: rgba(92, 184, 138, 0.1);
    color: var(--success);
    border: 1px solid rgba(92, 184, 138, 0.25);
}

.mensaje.loading {
    display: block;
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.admin-link {
    text-align: center;
    margin-top: 22px;
}

.admin-link a {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s;
}

.admin-link a:hover {
    color: var(--gold);
}

.hidden {
    display: none !important;
}

.auth-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-toggle a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.auth-toggle a:hover {
    text-decoration: underline;
}

.user-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border);
}

.user-bar span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--error);
    cursor: pointer;
    font-family: 'DM Sans';
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.logout-btn:hover {
    text-decoration: underline;
}

.btn-cancelar-turno {
    background: transparent;
    color: #e05c5c;
    border: 1px solid rgba(224, 92, 92, 0.3);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    margin-top: 8px;
    display: inline-block;
}

.btn-cancelar-turno:hover {
    background: rgba(224, 92, 92, 0.1);
    border-color: #e05c5c;
}

.turno-actions {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.2s;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeUp 0.3s ease out;
}

.modal-content h3 {
    font-family: 'Playfair Display', serif;
    color: var(--error);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.modal-content p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal-cancelar,
.btn-modal-confirmar {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-family: 'DM Sans';
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.btn-modal-cancelar {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-modal-cancelar:hover {
    background: var(--surface2);
}

.btn-modal-confirmar {
    background: rgba(224, 92, 92, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.btn-modal-confirmar:hover {
    background: var(--error);
    color: white;
}

/* Estilos para Modal de Confirmación de Turno (Mejorado) */
.modal-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.modal-confirmado-card {
    background: linear-gradient(150deg, #191919 0%, #121212 100%);
    border: 1px solid rgba(201, 168, 76, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(201, 168, 76, 0.12);
    padding: 28px 24px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-success-badge {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.success-icon-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(201, 168, 76, 0.12);
    border: 2px solid rgba(201, 168, 76, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
    animation: pulseRing 2.5s infinite ease-in-out;
}

.checkmark-svg {
    width: 38px;
    height: 38px;
    stroke: var(--gold);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--gold-light);
    animation: strokeCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.35s forwards;
}

@keyframes strokeCircle {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes strokeCheck {
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes pulseRing {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(201, 168, 76, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(201, 168, 76, 0.38);
    }
}

.modal-header-text {
    margin-bottom: 18px;
}

.modal-subtitle-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--gold);
    text-transform: uppercase;
    background: rgba(201, 168, 76, 0.12);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(201, 168, 76, 0.25);
    margin-bottom: 8px;
}

.modal-header-text h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.45rem;
    color: #ffffff;
    margin-bottom: 4px;
}

.modal-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.confirmado-ticket {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(201, 168, 76, 0.35);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px rgba(255, 255, 255, 0.08) solid;
}

.ticket-logo {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.ticket-status-badge {
    background: rgba(92, 184, 138, 0.15);
    color: var(--success);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(92, 184, 138, 0.3);
    letter-spacing: 0.05em;
}

.ticket-row.highlight-row {
    background: rgba(201, 168, 76, 0.08);
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 3px solid var(--gold);
    margin-bottom: 12px;
}

.ticket-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.field-value {
    font-size: 0.88rem;
    color: #ffffff;
    font-weight: 500;
}

.field-value.highlight {
    color: var(--gold-light);
    font-size: 1.05rem;
    font-weight: 700;
}

.ticket-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 10px;
    margin-bottom: 10px;
}

.ticket-footer-note {
    font-size: 0.76rem;
    color: var(--text-muted);
    padding-top: 10px;
    border-top: 1px rgba(255, 255, 255, 0.06) solid;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-actions-confirmado {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-modal-success-main {
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--gold) 0%, #a68432 100%);
    color: #0d0d0d;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}

.btn-modal-success-main:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 168, 76, 0.5);
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
}

.btn-calendar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e0e0e0;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-calendar-action:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(201, 168, 76, 0.4);
    color: #ffffff;
}