/* MRH Guest Portal - v0.5.0 - Stripe-style Premium */

:root {
    /* Color tokens - paleta MRH navy + greys premium */
    --color-navy: #1a3a5c;
    --color-navy-dark: #0f2540;
    --color-navy-hover: #14304d;
    --color-navy-ring: rgba(26, 58, 92, 0.12);
    
    --color-text-primary: #1a1f36;       /* Stripe ink black */
    --color-text-secondary: #697386;     /* Stripe grey 500 */
    --color-text-muted: #8792a2;         /* Stripe grey 400 */
    --color-text-placeholder: #a3acb9;   /* Stripe grey 300 */
    
    --color-bg: #f6f9fc;                 /* Stripe page bg */
    --color-bg-card: #ffffff;
    --color-bg-secondary: #f6f9fc;
    --color-bg-tertiary: #f0f4f8;
    
    --color-bg-warning: #fef3c7;
    --color-text-warning: #854f0b;
    --color-bg-success: #d1fae5;
    --color-text-success: #047857;
    --color-bg-error: #fee2e2;
    --color-text-error: #991b1b;
    
    --color-border: #e3e8ee;             /* Stripe border light */
    --color-border-input: #e0e6ed;       /* Stripe input border */
    --color-border-strong: #d1d9e0;
    
    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    --font-serif: 'Charter', 'Georgia', 'Times New Roman', serif;
    
    /* Geometry */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(60, 66, 87, 0.06);
    --shadow-md: 0 2px 5px -1px rgba(50, 50, 93, 0.08), 0 1px 3px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 7px 14px 0 rgba(60, 66, 87, 0.10), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
    --shadow-input: 0 1px 1px rgba(0, 0, 0, 0.02);
    --shadow-focus: 0 0 0 4px var(--color-navy-ring);
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-system);
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.portal-wrapper {
    max-width: 440px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--color-bg-card);
    display: flex;
    flex-direction: column;
}

/* HEADER */
.portal-header {
    background: var(--color-navy);
    padding: 22px 24px;
    color: white;
}
.portal-brand {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.2;
}
.portal-tagline {
    font-size: 12.5px;
    opacity: 0.75;
    font-style: italic;
    margin-top: 4px;
    letter-spacing: 0.01em;
    line-height: 1.3;
}

/* PROGRESS BAR */
.portal-progress {
    display: flex;
    gap: 4px;
    padding: 16px 24px;
    background: var(--color-bg-card);
    border-bottom: 1px solid var(--color-border);
}
.portal-progress-segment {
    flex: 1;
    height: 3px;
    background: var(--color-border);
    border-radius: 99px;
    transition: background 250ms ease;
}
.portal-progress-segment.active {
    background: var(--color-navy);
}

/* MAIN */
.portal-main {
    flex: 1;
    padding: 28px 24px 32px;
}

.portal-card {
    background: var(--color-bg-card);
}

/* TYPOGRAPHY */
.portal-title-serif {
    font-family: var(--font-serif);
    font-size: 30px;
    font-weight: 500;
    line-height: 1.15;
    margin-bottom: 6px;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

.portal-subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin: 0 0 28px;
    line-height: 1.5;
    letter-spacing: -0.005em;
}

/* BACK LINK */
.portal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 18px;
    padding: 4px 0;
    transition: color 150ms ease;
    letter-spacing: -0.005em;
}
.portal-back-link:hover {
    color: var(--color-navy);
}
.portal-back-link svg {
    width: 14px;
    height: 14px;
}

/* INFO CARDS */
.portal-info-card {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.portal-info-label {
    font-size: 11px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    font-weight: 600;
}
.portal-info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}
.portal-info-secondary {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 2px;
    letter-spacing: -0.005em;
}

.portal-info-card-readonly {
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    margin: 18px 0 24px;
    padding: 14px 16px;
}
.portal-info-card-readonly .portal-info-hint {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 6px;
    line-height: 1.45;
    letter-spacing: -0.005em;
}

/* LANGUAGE PICKER */
.portal-lang-picker {
    display: flex;
    gap: 6px;
    margin: 20px 0;
}
.portal-lang-btn {
    flex: 1;
    text-align: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-secondary);
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: all 150ms ease;
    border: 1px solid var(--color-border);
}
.portal-lang-btn.active {
    background: var(--color-navy);
    color: white;
    border-color: var(--color-navy);
}
.portal-lang-btn:hover:not(.active) {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    border-color: var(--color-border-strong);
}

/* COMPLIANCE NOTE */
.portal-compliance-note {
    font-size: 12px;
    color: var(--color-text-warning);
    background: var(--color-bg-warning);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    line-height: 1.5;
    margin: 20px 0;
    letter-spacing: -0.005em;
}

/* ===================== */
/* FORM - STRIPE STYLE   */
/* ===================== */

.portal-form {
    margin: 0;
}

.portal-field {
    margin-bottom: 20px;
}

.portal-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

/* Input wrapper - permite icono ABSOLUTO dentro */
.portal-input-wrapper {
    position: relative;
    display: block;
}

.portal-input-wrapper .portal-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease;
}

.portal-input-wrapper .portal-input-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.portal-field input[type="text"],
.portal-field input[type="email"],
.portal-field input[type="tel"],
.portal-field input[type="date"],
.portal-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px 11px 42px;  /* padding-left 42px para icono */
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--color-text-primary);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-input);
    transition: border-color 150ms ease, box-shadow 150ms ease;
    -webkit-appearance: none;
    appearance: none;
    letter-spacing: -0.005em;
}

/* Input sin icono - usar padding normal */
.portal-field input.no-icon {
    padding-left: 14px;
}

.portal-field input::placeholder {
    color: var(--color-text-placeholder);
}

.portal-field input:hover:not(:focus) {
    border-color: var(--color-border-strong);
}

.portal-field input:focus,
.portal-field select:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: var(--shadow-focus);
}

.portal-field input:focus + .portal-input-icon,
.portal-input-wrapper:focus-within .portal-input-icon {
    color: var(--color-navy);
}

.portal-field input.error,
.portal-field input.error:focus {
    border-color: #df1b41;
    box-shadow: 0 0 0 4px rgba(223, 27, 65, 0.12);
}

.portal-field-hint {
    font-size: 12.5px;
    color: var(--color-text-secondary);
    margin: 6px 0 0;
    line-height: 1.45;
    letter-spacing: -0.005em;
}

.portal-field-error {
    font-size: 12.5px;
    color: #df1b41;
    margin-top: 6px;
    min-height: 16px;
    line-height: 1.4;
    letter-spacing: -0.005em;
}

.portal-form-error {
    background: var(--color-bg-error);
    color: var(--color-text-error);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin: 14px 0;
    line-height: 1.4;
    border: 1px solid rgba(223, 27, 65, 0.2);
}

/* CHECKBOX CARD */
.portal-checkbox-row {
    margin: 18px 0 24px;
    padding: 14px 16px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    transition: border-color 150ms ease, background 150ms ease;
}
.portal-checkbox-row:hover {
    border-color: var(--color-border-strong);
    background: var(--color-bg-secondary);
}

.portal-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13.5px;
    color: var(--color-text-primary);
    line-height: 1.5;
    letter-spacing: -0.005em;
}

.portal-checkbox-label input[type="checkbox"] {
    margin-top: 1px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-navy);
    flex-shrink: 0;
}

.portal-checkbox-label .checkbox-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}
.portal-checkbox-label .checkbox-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* BUTTONS */
.portal-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 18px;
    background: var(--color-navy);
    color: white;
    border: 1px solid var(--color-navy);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms ease, transform 100ms ease, box-shadow 150ms ease;
    font-family: inherit;
    letter-spacing: -0.005em;
    box-shadow: var(--shadow-sm);
}
.portal-btn-primary:hover:not(:disabled) {
    background: var(--color-navy-hover);
    box-shadow: var(--shadow-md);
}
.portal-btn-primary:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: var(--shadow-sm);
}
.portal-btn-primary:disabled,
.portal-btn-primary[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.portal-btn-primary svg {
    width: 16px;
    height: 16px;
    transition: transform 150ms ease;
}
.portal-btn-primary:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.portal-btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    text-decoration: none;
    margin-top: 6px;
}

/* ERROR STATES */
.portal-error {
    text-align: center;
    padding: 32px 20px;
}
.portal-error-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: white;
}
.portal-error-icon-red { background: #df1b41; }
.portal-error-icon-amber { background: #d97706; }
.portal-error-body {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.55;
    margin: 0 0 24px;
    letter-spacing: -0.005em;
}

/* FOOTER */
.portal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.01em;
}
.portal-footer a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color 150ms ease;
}
.portal-footer a:hover {
    color: var(--color-text-secondary);
}

/* RESPONSIVE - Desktop */
@media (min-width: 441px) {
    body {
        padding: 32px 16px;
    }
    .portal-wrapper {
        margin: 0 auto;
        border-radius: var(--radius-xl);
        overflow: hidden;
        box-shadow: var(--shadow-lg);
        min-height: auto;
    }
}

/* RESPONSIVE - Mobile */
@media (max-width: 440px) {
    .portal-main {
        padding: 24px 20px 28px;
    }
    .portal-title-serif {
        font-size: 26px;
    }
    .portal-header {
        padding: 20px 20px;
    }
    .portal-progress {
        padding: 14px 20px;
    }
    .portal-footer {
        padding: 14px 20px;
    }
}

/* ===================== */
/* STEP 3 - COMPLIANCE   */
/* ===================== */

/* Compliance secure note (verde sutil en vez de amber) */
.portal-compliance-note-secure {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.portal-compliance-icon {
    flex-shrink: 0;
    color: #0284c7;
    margin-top: 1px;
}
.portal-compliance-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Guest cards container */
.portal-guest-cards-container {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual guest card */
.portal-guest-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 200ms ease, box-shadow 200ms ease;
}
.portal-guest-card:hover {
    border-color: var(--color-border-strong);
}
.portal-guest-card.is-open {
    border-color: var(--color-navy);
    box-shadow: 0 0 0 3px var(--color-navy-ring);
}
.portal-guest-card.guest-status-done {
    background: #f8fafc;
}
.portal-guest-card.guest-status-done:not(.is-open) .portal-guest-card-icon {
    color: #059669;
}

/* Card header */
.portal-guest-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}
.portal-guest-card.is-open .portal-guest-card-header {
    border-bottom: 1px solid var(--color-border);
}
.portal-guest-card-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.portal-guest-card-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
    transition: color 150ms ease;
}
.portal-guest-card-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}
.portal-guest-card-info {
    min-width: 0;
    flex: 1;
}
.portal-guest-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.portal-guest-card-name {
    color: var(--color-text-secondary);
    font-weight: 400;
}
.portal-guest-card-subtitle {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

/* Status badge */
.portal-guest-card-status {
    flex-shrink: 0;
}
.portal-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.portal-status-pending {
    background: #f3f4f6;
    color: #6b7280;
}
.portal-status-filling {
    background: #fef3c7;
    color: #854f0b;
}
.portal-status-done {
    background: #d1fae5;
    color: #047857;
}

/* Card body */
.portal-guest-card-body {
    padding: 18px 16px;
    border-top: 1px solid var(--color-border);
}
.portal-guest-card[hidden],
.portal-guest-card-body[hidden] {
    display: none;
}

/* Form rows (2 columns) */
.portal-field-row {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}
.portal-field-row-2 {
    grid-template-columns: 1fr 1fr;
}
.portal-field-row .portal-field {
    margin-bottom: 0;
}

/* Select */
.portal-field select.no-icon {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697386' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    padding-right: 38px;
    cursor: pointer;
}

/* Country autocomplete */
.portal-country-input {
    position: relative;
}
.portal-country-search {
    width: 100%;
}
.portal-country-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
}
.portal-country-dropdown[hidden] {
    display: none;
}
.portal-country-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--color-text-primary);
    letter-spacing: -0.005em;
    transition: background 100ms ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.portal-country-option:hover,
.portal-country-option.is-active {
    background: var(--color-bg-secondary);
}
.portal-country-option-code {
    font-size: 11px;
    color: var(--color-text-muted);
    font-family: monospace;
    flex-shrink: 0;
}
.portal-country-dropdown-priority-separator {
    border-top: 1px solid var(--color-border);
    margin: 4px 0;
}
.portal-country-empty {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}

/* Address shared notice (cuando dirección heredada) */
.portal-address-shared-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}
.portal-address-shared-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
}
.portal-address-shared-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}
.portal-address-shared-notice span:first-of-type {
    flex: 1;
}
.portal-btn-text {
    background: transparent;
    border: none;
    color: var(--color-navy);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    padding: 2px 6px;
    font-family: inherit;
}
.portal-btn-text:hover {
    color: var(--color-navy-hover);
}

/* Save guest button */
.portal-btn-save-guest {
    margin-top: 18px;
}

/* Step 3 completion status */
.portal-step3-status {
    text-align: center;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Hidden helper */
[hidden] {
    display: none !important;
}

/* Mobile responsive for step 3 */
@media (max-width: 440px) {
    .portal-field-row-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .portal-guest-card-header {
        padding: 12px 14px;
    }
    .portal-guest-card-body {
        padding: 16px 14px;
    }
    .portal-address-shared-notice {
        flex-wrap: wrap;
    }
    .portal-address-shared-notice .portal-btn-text {
        flex: 1 0 100%;
        text-align: left;
        padding-left: 0;
    }
}

/* === STEP 3 PADDING FIXES === */

/* Mas padding interno en card body */
.portal-guest-card-body {
    padding: 20px 18px;
}

/* En mobile mantener compacto pero respirable */
@media (max-width: 440px) {
    .portal-guest-card-body {
        padding: 18px 16px;
    }
}

/* Espacio entre filas de fields */
.portal-field-row {
    margin-bottom: 18px;
}

/* Asegurar que el ultimo field no tenga margen abajo (antes del separador o boton) */
.portal-guest-form > *:last-child {
    margin-bottom: 0;
}

/* Mejor jerarquia visual del card title */
.portal-guest-card-title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.portal-guest-card-name {
    font-weight: 400;
    color: var(--color-text-secondary);
}

/* ===================== */
/* STEP 4 - ARRIVAL      */
/* ===================== */

/* Section blocks (group related fields) */
.portal-section {
    margin-bottom: 24px;
}
.portal-section:last-of-type {
    margin-bottom: 16px;
}
.portal-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
}
.portal-section-helper {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    letter-spacing: -0.005em;
}

/* Travel mode radio cards */
.portal-travel-modes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.portal-travel-mode {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 8px;
    background: var(--color-bg-card);
    border: 1.5px solid var(--color-border-input);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
    text-align: center;
    user-select: none;
}
.portal-travel-mode:hover:not(.is-selected) {
    border-color: var(--color-border-strong);
    background: var(--color-bg-secondary);
}
.portal-travel-mode.is-selected {
    border-color: var(--color-navy);
    background: var(--color-navy-light);
    box-shadow: 0 0 0 3px var(--color-navy-ring);
}
.portal-travel-mode input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.portal-travel-mode-icon {
    color: var(--color-text-secondary);
    transition: color 150ms ease;
}
.portal-travel-mode-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.portal-travel-mode.is-selected .portal-travel-mode-icon {
    color: var(--color-navy);
}
.portal-travel-mode-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: -0.005em;
}

/* Mode-specific fields wrapper */
.portal-mode-fields {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}
.portal-mode-fields > .portal-field:last-child {
    margin-bottom: 0;
}

/* Time inputs need wrapper for icon */
.portal-field input[type="time"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--color-border-input);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    color: var(--color-text-primary);
    background: var(--color-bg-card);
    box-shadow: var(--shadow-input);
    transition: border-color 150ms ease, box-shadow 150ms ease;
    -webkit-appearance: none;
    appearance: none;
}
.portal-field input[type="time"]:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: var(--shadow-focus);
}

/* Late check-in warning */
.portal-late-warning {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #854f0b;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-top: 12px;
}
.portal-late-icon {
    flex-shrink: 0;
    color: #d97706;
    margin-top: 2px;
}
.portal-late-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}
.portal-late-content {
    flex: 1;
    min-width: 0;
}
.portal-late-content strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: -0.005em;
}
.portal-late-content p {
    font-size: 12.5px;
    margin: 0;
    line-height: 1.45;
    letter-spacing: -0.005em;
}

/* Mobile responsive */
@media (max-width: 440px) {
    .portal-travel-modes {
        gap: 6px;
    }
    .portal-travel-mode {
        padding: 12px 6px;
    }
    .portal-travel-mode-icon svg {
        width: 20px;
        height: 20px;
    }
    .portal-travel-mode-label {
        font-size: 12.5px;
    }
}

/* === STEP 4 v2: Checkout Refactor === */

.portal-checkout-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.portal-checkout-info-icon {
    flex-shrink: 0;
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.portal-checkout-info-icon svg { width: 18px; height: 18px; display: block; }
.portal-checkout-info-content strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 3px;
    letter-spacing: -0.005em;
}
.portal-checkout-info-content p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.45;
}

/* Late checkout toggle block */
.portal-late-checkout-block {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.portal-late-checkout-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}
.portal-late-checkout-toggle input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--color-navy);
}
.portal-late-checkout-toggle-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.005em;
}
.portal-late-checkout-toggle-sub {
    display: block;
    font-size: 12.5px;
    color: var(--color-text-secondary);
    margin-top: 2px;
    line-height: 1.4;
}

/* Late checkout fields container */
.portal-late-checkout-fields {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--color-border);
}

/* Disclaimer (similar to late warning but neutral tone) */
.portal-late-checkout-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-top: 12px;
}
.portal-late-checkout-disclaimer .portal-late-icon {
    flex-shrink: 0;
    color: #2563eb;
    margin-top: 2px;
}
.portal-late-checkout-disclaimer strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    letter-spacing: -0.005em;
}
.portal-late-checkout-disclaimer p {
    font-size: 12.5px;
    margin: 0;
    line-height: 1.5;
    color: #1e3a8a;
}

/* Late checkout unavailable block */
.portal-late-checkout-unavailable {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--color-bg-secondary);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    color: var(--color-text-secondary);
}
.portal-late-checkout-unavailable strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 3px;
    letter-spacing: -0.005em;
}
.portal-late-checkout-unavailable p {
    font-size: 12.5px;
    margin: 0;
    line-height: 1.45;
}

@media (max-width: 440px) {
    .portal-late-checkout-block,
    .portal-checkout-info,
    .portal-late-checkout-unavailable {
        padding: 12px 14px;
    }
}

/* ===================== */
/* STEP 5 - EXTRAS       */
/* ===================== */

.portal-extras-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-extra-card {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 16px;
    background: var(--color-bg-card);
    border: 1.5px solid var(--color-border-input);
    border-radius: var(--radius-md);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.portal-extra-card.is-selected {
    border-color: #10b981;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.portal-extra-card.portal-extra-partner {
    border-color: var(--color-border);
    background: var(--color-bg-secondary);
}

.portal-extra-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--color-navy-light);
    color: var(--color-navy);
    flex-shrink: 0;
}
.portal-extra-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.portal-extra-card.is-selected .portal-extra-icon {
    background: #d1fae5;
    color: #047857;
}
.portal-extra-icon-partner {
    background: #fef3c7;
    color: #b45309;
}

.portal-extra-content {
    min-width: 0;
}
.portal-extra-name {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.portal-extra-partner-tag {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.portal-extra-desc {
    font-size: 12.5px;
    color: var(--color-text-secondary);
    margin: 4px 0 8px 0;
    line-height: 1.45;
    letter-spacing: -0.005em;
}
.portal-extra-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}
.portal-extra-price-partner {
    color: var(--color-text-secondary);
    font-weight: 500;
}

.portal-extra-action {
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
}

.portal-extra-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    border: 1.5px solid;
    border-radius: var(--radius-md);
    background: var(--color-bg-card);
    cursor: pointer;
    transition: all 150ms ease;
    font-family: inherit;
    text-decoration: none;
    letter-spacing: -0.005em;
    white-space: nowrap;
}

.portal-extra-btn-icon {
    display: inline-flex;
    align-items: center;
}
.portal-extra-btn-icon svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* ADD button (default state) */
.portal-extra-btn-add {
    border-color: var(--color-navy);
    color: var(--color-navy);
}
.portal-extra-btn-add:hover {
    background: var(--color-navy);
    color: white;
}

/* ADDED button (selected state) */
.portal-extra-btn-added {
    border-color: #10b981;
    color: #047857;
    background: #d1fae5;
    display: none; /* hidden by default */
}
.portal-extra-btn-added:hover {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #ef4444;
}

/* Toggle visibility based on is-selected */
.portal-extra-card.is-selected .portal-extra-btn-add { display: none; }
.portal-extra-card.is-selected .portal-extra-btn-added { display: inline-flex; }

/* Partner button (link external) */
.portal-extra-btn-partner {
    border-color: #b45309;
    color: #b45309;
}
.portal-extra-btn-partner:hover {
    background: #b45309;
    color: white;
}

/* Step 5 summary */
.portal-step5-summary {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}
.portal-step5-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}
.portal-step5-total-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.portal-step5-total-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.015em;
}
.portal-step5-count-row {
    font-size: 12.5px;
    color: var(--color-text-secondary);
}

.portal-step5-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    color: #1e40af;
    line-height: 1.45;
}
.portal-step5-note-icon {
    flex-shrink: 0;
    color: #2563eb;
    margin-top: 1px;
}
.portal-step5-note-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* Actions row */
.portal-step5-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.portal-step5-actions .portal-btn-secondary {
    flex: 0 0 auto;
    padding: 12px 18px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 150ms ease;
}
.portal-step5-actions .portal-btn-secondary:hover {
    background: var(--color-border);
}
.portal-step5-actions .portal-btn-primary {
    flex: 1;
}

/* Empty state */
.portal-empty-state {
    padding: 32px 16px;
    text-align: center;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 440px) {
    .portal-extra-card {
        grid-template-columns: 36px 1fr;
        gap: 10px;
        padding: 12px 14px;
    }
    .portal-extra-action {
        grid-column: 1 / -1;
        margin-top: 4px;
    }
    .portal-extra-btn {
        width: 100%;
        justify-content: center;
    }
    .portal-extra-icon {
        width: 36px;
        height: 36px;
    }
    .portal-extra-icon svg {
        width: 18px;
        height: 18px;
    }
    .portal-step5-actions {
        flex-direction: column-reverse;
    }
    .portal-step5-actions .portal-btn-secondary,
    .portal-step5-actions .portal-btn-primary {
        width: 100%;
    }
}

/* ===================== */
/* STEP 6 - THANK YOU    */
/* ===================== */

.portal-step6 { }

.portal-step6-hero {
    text-align: center;
    padding: 8px 0 24px 0;
}

.portal-step6-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    margin-bottom: 16px;
}
.portal-step6-check svg {
    width: 36px;
    height: 36px;
}

.portal-step6-title {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 500;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 8px 0;
}

.portal-step6-subtitle {
    font-size: 15px;
    color: var(--color-text-secondary);
    margin: 0 0 12px 0;
}

.portal-step6-message {
    font-size: 13.5px;
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
}

.portal-step6-divider {
    height: 1px;
    background: var(--color-border);
    margin: 20px 0;
}

.portal-step6-section {
    margin-bottom: 18px;
}

.portal-step6-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    margin: 0 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.portal-step6-section-total {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.portal-step6-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    font-size: 14px;
    color: var(--color-text-primary);
}

.portal-step6-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--color-navy);
    flex-shrink: 0;
    margin-top: 1px;
}
.portal-step6-icon svg { width: 16px; height: 16px; }

.portal-step6-icon-small svg { width: 14px; height: 14px; }

.portal-step6-guest-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.portal-step6-guest-name {
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.portal-step6-guest-doc {
    font-size: 12px;
    color: var(--color-text-secondary);
}

.portal-step6-badge {
    display: inline-block;
    background: var(--color-navy);
    color: white;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}
.portal-step6-badge-minor {
    background: #f59e0b;
    color: white;
}

.portal-step6-detail {
    font-size: 12.5px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}
.portal-step6-detail-warn {
    color: #b45309;
}

.portal-step6-extra-row {
    justify-content: flex-start;
    gap: 10px;
}
.portal-step6-extra-name {
    flex: 1;
    font-weight: 500;
    text-transform: capitalize;
}
.portal-step6-extra-price {
    font-weight: 600;
    color: var(--color-text-primary);
}

.portal-step6-note-small {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-top: 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    font-size: 12px;
    color: #1e40af;
}

.portal-step6-actions {
    display: flex;
    justify-content: center;
    margin: 18px 0 8px 0;
}
.portal-step6-actions .portal-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.portal-step6-actions .portal-btn-secondary svg {
    width: 16px;
    height: 16px;
}
.portal-step6-actions .portal-btn-secondary:hover {
    background: var(--color-border);
}

.portal-step6-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 10px;
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
}

@media print {
    body { background: white !important; }
    .portal-back-link, .portal-step6-actions { display: none !important; }
    .portal-card { box-shadow: none !important; border: none !important; }
}

@media (max-width: 440px) {
    .portal-step6-check { width: 56px; height: 56px; }
    .portal-step6-check svg { width: 30px; height: 30px; }
    .portal-step6-title { font-size: 25px; }
    .portal-step6-row { font-size: 13.5px; }
}

/* ===================== */
/* STEP 6 - EDIT WINDOW  */
/* ===================== */

.portal-step6-edit-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin: 16px 0 8px 0;
    font-size: 13px;
    line-height: 1.4;
}

.portal-step6-edit-banner-open {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.portal-step6-edit-banner-locked {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.portal-step6-edit-banner-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
}
.portal-step6-edit-banner-icon svg {
    width: 16px;
    height: 16px;
}
.portal-step6-edit-banner-open .portal-step6-edit-banner-icon {
    color: #065f46;
}
.portal-step6-edit-banner-locked .portal-step6-edit-banner-icon {
    color: #991b1b;
}

.portal-step6-edit-banner-text {
    flex: 1;
    min-width: 0;
}
.portal-step6-edit-banner-text strong {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}
.portal-step6-edit-banner-sub {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.45;
}

.portal-step6-edit-banner-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #065f46;
    color: white;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    transition: background 150ms ease;
}
.portal-step6-edit-banner-btn:hover {
    background: #047857;
    text-decoration: none;
}

@media (max-width: 440px) {
    .portal-step6-edit-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .portal-step6-edit-banner-btn {
        width: 100%;
        padding: 10px;
    }
    .portal-step6-edit-banner-icon {
        align-self: flex-start;
    }
}

/* A.6.f UX polish - error banner + shake + has-error states */
.portal-error-banner {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 18px;
    color: #92400E;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    animation: portalFadeIn 250ms ease;
}
.portal-error-banner-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.portal-error-banner-title:before {
    content: '\26A0';
    font-size: 18px;
}
.portal-error-banner-list {
    margin: 0;
    padding-left: 24px;
    font-size: 13px;
    line-height: 1.6;
}
.portal-error-banner-list li {
    margin-bottom: 2px;
}
.portal-btn-shake {
    animation: portalShake 420ms cubic-bezier(.36,.07,.19,.97);
}
@keyframes portalShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}
@keyframes portalFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.portal-field-error:not(:empty) {
    color: #DC2626;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 500;
}
input.error, select.error {
    border-color: #DC2626 !important;
    background-color: #FEF2F2;
}
input.error:focus, select.error:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
