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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f2f2f7;
    color: #1c1c1e;
    height: 100%;
}

/* ════════════════════════════════════════
   LOGIN  (copia exacta de Softours-WEB)
════════════════════════════════════════ */
:root {
    --primary-color: #2563eb;
    --primary-dark:  #1e40af;
    --error-color:   #ef4444;
    --bg-start:      #1e3a8a;
    --bg-mid:        #2563eb;
    --bg-end:        #06b6d4;
}

.contenedor-login {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-mid) 50%, var(--bg-end) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    overflow: hidden;
    z-index: 1;
}

@keyframes gradientShift {
    0%   { background-position: 0%   50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   50%; }
}

/* Decoración de fondo */
.bg-decoration { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.circle { position: absolute; border-radius: 50%; background: rgba(255,255,255,.05); backdrop-filter: blur(5px); }
.circle-1 { width: 300px; height: 300px; top: -150px; left: -150px; animation: float 20s infinite ease-in-out; }
.circle-2 { width: 500px; height: 500px; bottom: -250px; right: -250px; animation: float 25s infinite ease-in-out reverse; }
.circle-3 { width: 200px; height: 200px; top: 50%; left: 10%; animation: float 15s infinite ease-in-out; }

@keyframes float {
    0%,100% { transform: translate(0,0) rotate(0deg); }
    33%      { transform: translate(30px,-30px) rotate(120deg); }
    66%      { transform: translate(-20px,20px) rotate(240deg); }
}

/* Card */
.login-card {
    position: relative;
    z-index: 10;
    width: 420px;
    background: rgba(255,255,255,.95);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,.2);
    overflow: hidden;
    animation: slideUp .6s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-header {
    padding: 40px 40px 30px;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(37,99,235,.05) 100%);
}

.logo-container { position: relative; display: inline-block; margin-bottom: 20px; }

.img-logo {
    width: 100px; height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    position: relative; z-index: 2;
    transition: transform .3s;
}
.img-logo:hover { transform: scale(1.05); }

.logo-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(37,99,235,.4) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,100% { opacity: .6; transform: translate(-50%,-50%) scale(1); }
    50%      { opacity: .3; transform: translate(-50%,-50%) scale(1.1); }
}

.welcome-text { font-size: 28px; font-weight: 700; color: #1e293b; margin-bottom: 8px; }
.subtitle     { color: #64748b; font-size: 14px; margin-bottom: 12px; }

.credencial-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37,99,235,.08);
    border: 1px solid rgba(37,99,235,.2);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e40af;
    margin-top: 4px;
}
.credencial-hint i { font-size: 15px; flex-shrink: 0; color: #2563eb; }

.card-body { padding: 0 40px 30px; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.alert-danger { background: rgba(239,68,68,.1); color: var(--error-color); border: 1px solid rgba(239,68,68,.2); }

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

.input-group {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all .3s;
}
.input-group:focus-within {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37,99,235,.1);
}
.input-error { border-color: var(--error-color) !important; }

.input-icon {
    position: absolute; left: 16px;
    color: #94a3b8; font-size: 18px;
    transition: color .3s; z-index: 1;
}
.input-group:focus-within .input-icon { color: var(--primary-color); }

.form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: none; background: transparent;
    font-size: 15px; color: #1e293b;
    outline: none;
}
.form-input::placeholder { color: #94a3b8; }

.validation-message {
    display: block; font-size: 12px;
    color: var(--error-color);
    margin-top: 4px; min-height: 16px;
}

.btn-login {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white; border: none;
    border-radius: 12px;
    font-size: 16px; font-weight: 600;
    cursor: pointer;
    transition: all .3s;
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 24px;
}
.btn-login::before {
    content: '';
    position: absolute; top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
    transition: left .5s;
}
.btn-login:hover:not(:disabled)::before { left: 100%; }
.btn-login:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(37,99,235,.3); }
.btn-login:disabled { opacity: .6; cursor: not-allowed; background: linear-gradient(135deg,#9ca3af,#6b7280); }

.btn-text  { position: relative; z-index: 1; }
.btn-icon  { position: relative; z-index: 1; transition: transform .3s; }
.btn-login:hover:not(:disabled) .btn-icon { transform: translateX(4px); }

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

.recordarme-row {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.recordarme-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.recordarme-check { display: none; }

.recordarme-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 20px;
    transition: background .25s;
    flex-shrink: 0;
}

.recordarme-slider::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    background: white;
    border-radius: 50%;
    transition: transform .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.recordarme-check:checked + .recordarme-slider {
    background: var(--primary-color);
}

.recordarme-check:checked + .recordarme-slider::after {
    transform: translateX(16px);
}

.recordarme-texto {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}
    padding: 20px; text-align: center;
    border-top: 1px solid rgba(0,0,0,.05);
    background: rgba(248,250,252,.5);
}
.footer-text { font-size: 12px; color: #94a3b8; }

@media (max-width: 480px) {
    .login-card { width: calc(100% - 32px); }
    .card-header, .card-body { padding-left: 24px; padding-right: 24px; }
    .welcome-text { font-size: 24px; }
}

/* ════════════════════════════════════════
   APP SHELL
════════════════════════════════════════ */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.top-bar {
    background: white;
    border-bottom: 1px solid #e5e5ea;
    height: 58px;
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.top-bar-inner {
    max-width: 600px; margin: 0 auto;
    height: 100%; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
}
.top-bar-brand { display: flex; align-items: center; gap: 10px; }
.top-logo      { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.top-bar-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #1e6fff 0%, #0a3ebd 50%, #062d99 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(2px 3px 0px rgba(0,0,0,.25))
            drop-shadow(0px 1px 0px rgba(255,255,255,.4));
}

.top-bar-user  { display: flex; align-items: center; gap: 12px; }

.user-info     { display: flex; flex-direction: column; align-items: flex-end; }
.user-name     { font-size: 13px; font-weight: 700; color: #1c1c1e; display: flex; align-items: center; gap: 5px; }
.user-dni      { font-size: 11px; color: #8e8e93; }

@media (max-width: 420px) { .user-info { display: none; } }

.btn-logout {
    background: none;
    border: 1.5px solid var(--error-color);
    color: var(--error-color);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 12px; font-weight: 600;
    cursor: pointer; transition: all .2s;
    display: flex; align-items: center; gap: 5px;
}
.btn-logout:hover { background: var(--error-color); color: white; }

.main-content { flex: 1; }

/* ════════════════════════════════════════
   MIS VIAJES
════════════════════════════════════════ */
.viajes-container {
    max-width: 540px;
    margin: 0 auto;
    padding: 28px 16px 60px;
}

.viajes-titulo {
    font-size: 30px; font-weight: 800;
    color: #1c1c1e; margin-bottom: 20px;
}

/* Tabs */
.viajes-tabs {
    display: flex;
    border-bottom: 1.5px solid #e5e5ea;
    margin-bottom: 24px;
}
.tab {
    flex: 1; background: none; border: none;
    padding: 12px 0; font-size: 15px; font-weight: 500;
    color: #8e8e93; cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    transition: all .2s;
}
.tab-active {
    color: #1c1c1e; font-weight: 700;
    border-bottom-color: #e5251b;
}

/* Cards */
.viajes-lista { display: flex; flex-direction: column; gap: 14px; }

.viaje-card {
    background: white;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border: 1.5px solid transparent;
}
.viaje-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-color: rgba(37,99,235,.15);
}
.card-anulado { opacity: .65; }

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}
.card-titulo-row { display: flex; align-items: flex-start; gap: 10px; }
.card-icon       { font-size: 24px; }
.card-titulo     { font-size: 17px; font-weight: 700; color: #1c1c1e; margin-bottom: 3px; }
.card-sub        { font-size: 12px; color: #8e8e93; }

/* Badge */
.badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.badge-activo  { background: #d1fae5; color: #065f46; }
.badge-anulado { background: #fee2e2; color: #991b1b; }

/* Fechas */
.card-fechas {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 16px;
}
.fecha-bloque { display: flex; flex-direction: column; }
.fecha-label  { font-size: 10px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; color: #8e8e93; margin-bottom: 3px; }
.fecha-val    { font-size: 14px; font-weight: 700; color: #1c1c1e; }
.fecha-sep    { color: #c7c7cc; font-size: 20px; }

/* Meta */
.card-meta {
    font-size: 13px; color: #636366;
    margin-top: 6px;
    display: flex; align-items: center; gap: 6px;
}
.servicio-meta { color: #2563eb; }
.deta-servicio-meta { color: #475569; font-size: 12px; line-height: 1.4; white-space: pre-line; }

/* Estados */
.loading-state, .empty-state, .error-state {
    text-align: center; padding: 60px 20px; color: #8e8e93;
}
.empty-state h3   { font-size: 18px; color: #3a3a3c; font-weight: 700; margin: 16px 0 8px; }
.empty-state p    { font-size: 14px; }
.error-state      { color: #dc2626; }
.error-state p    { margin: 12px 0; }

.spinner-grande {
    width: 44px; height: 44px;
    border: 3px solid #e5e5ea;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin: 0 auto 16px;
}

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

.btn-reintentar {
    background: var(--primary-color); color: white;
    border: none; border-radius: 10px;
    padding: 10px 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}

/* ════════════════════════════════════════
   MODAL DETALLE
════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 1000;
}

.modal-sheet {
    background: white;
    border-radius: 24px 24px 0 0;
    width: 100%; max-width: 600px;
    padding: 12px 24px 32px;
    max-height: 88vh;
    overflow-y: auto;
    animation: sheetUp .25s ease;
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.modal-handle {
    width: 40px; height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 16px;
}

.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.modal-header h2 { font-size: 20px; font-weight: 700; }

.modal-close {
    background: #f2f2f7; border: none;
    border-radius: 50%; width: 34px; height: 34px;
    cursor: pointer; font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    color: #636366; transition: background .2s;
}
.modal-close:hover { background: #e5e5ea; }

/* Filas detalle */
.detalle-grid  { display: flex; flex-direction: column; gap: 0; }
.detalle-row {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid #f2f2f7;
}
.detalle-row:last-child { border-bottom: none; }
.detalle-full  { flex-direction: column; gap: 6px; }
.detalle-label { font-size: 12px; color: #8e8e93; font-weight: 600; flex-shrink: 0; text-transform: uppercase; letter-spacing: .4px; }
.detalle-valor { font-size: 14px; color: #1c1c1e; font-weight: 500; text-align: right; }
.valor-destacado { font-size: 20px; font-weight: 800; color: var(--primary-color); }
.itinerario-text { text-align: left; font-size: 13px; line-height: 1.5; }

/* ════════════════════════════════════════
   BLAZOR ERROR
════════════════════════════════════════ */
#blazor-error-ui {
    background: #fff3cd; padding: 12px;
    text-align: center; font-size: 14px;
    display: none;
    position: fixed; bottom: 0; width: 100%;
    z-index: 9999;
}
