:root {
    --lr-orange: #f97316;
    --lr-orange-hover: #ea580c;
    --lr-orange-soft: #fff7ed;
    --lr-dark: #1f2937;
    --lr-dark-hover: #111827;
    --lr-muted: #6b7280;
    --lr-border: #d1d5db;
    --lr-border-focus: #f97316;
    --lr-bg: #f3f4f6;
    --lr-card-bg: #ffffff;
    --lr-danger: #dc2626;
}

/* ==========================================================================
   Header & Topbar
   ========================================================================== */
.lr-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: #111827;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lr-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.lr-back {
    color: #e5e7eb;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.lr-back:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

/* ==========================================================================
   Main Layout & Card Container
   ========================================================================== */
.lr-main {
    padding: 36px 16px 72px;
    background: var(--lr-bg);
    min-height: calc(100vh - 74px);
}

.lr-card {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 36px 40px;
    background: var(--lr-card-bg);
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
}

/* ==========================================================================
   Heading & Provider Information
   ========================================================================== */
.lr-heading {
    text-align: center;
    margin-bottom: 28px;
}

.lr-heading h1 {
    margin: 12px 0 4px;
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-weight: 800;
    color: var(--lr-dark);
    letter-spacing: -0.01em;
}

.lr-heading p {
    margin: 0;
    color: var(--lr-orange);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lr-book-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.3);
}

.lr-book-icon svg {
    width: 26px;
    height: 26px;
}

.lr-provider {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 28px;
    margin-bottom: 32px;
    padding: 20px 24px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid var(--lr-orange);
    border-radius: 8px;
    font-size: 0.92rem;
    color: var(--lr-dark);
    line-height: 1.5;
}

.lr-provider-full,
.lr-provider > div:first-child {
    grid-column: 1 / -1;
}

.lr-provider strong {
    color: #0f172a;
}

/* ==========================================================================
   Sections & Legends
   ========================================================================== */
.lr-section {
    margin: 0 0 28px;
    padding: 0;
    border: 0;
}

.lr-section legend {
    width: 100%;
    margin-bottom: 18px;
    padding: 10px 14px;
    background: #1e293b;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: 8px;
    letter-spacing: 0.01em;
}

.lr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* ==========================================================================
   Form Fields (Text, Select, Textarea)
   ========================================================================== */
.lr-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.lr-field label,
.lr-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--lr-dark);
}

.lr-required {
    color: var(--lr-danger);
    margin-left: 2px;
}

/* Specificity fix: Exclude radio and checkbox from full-width input styles */
.lr-field input:not([type="checkbox"]):not([type="radio"]),
.lr-field select,
.lr-field textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--lr-border);
    border-radius: 8px;
    font: inherit;
    font-size: 0.92rem;
    color: var(--lr-dark);
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lr-field select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    appearance: none;
    padding-right: 36px;
}

.lr-field textarea {
    resize: vertical;
    min-height: 80px;
}

.lr-field input:not([type="checkbox"]):not([type="radio"]):focus,
.lr-field select:focus,
.lr-field textarea:focus {
    outline: none;
    border-color: var(--lr-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}

/* ==========================================================================
   Radio Options & Checkboxes (Aesthetics Correction)
   ========================================================================== */

/* Exact sizing for radio and checkbox elements to prevent stretching */
.lr-main input[type="radio"],
.lr-main input[type="checkbox"],
.lr-field input[type="radio"],
.lr-field input[type="checkbox"],
.lr-option input[type="radio"],
.lr-inline-check input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    cursor: pointer;
    vertical-align: middle;
}

/* Override Bootstrap form-check-input default blue with brand orange */
.lr-main .form-check-input {
    border: 1.5px solid var(--lr-border);
    background-color: #fff;
    outline: none !important;
}

.lr-main .form-check-input:checked {
    background-color: var(--lr-orange) !important;
    border-color: var(--lr-orange) !important;
}

.lr-main .form-check-input:focus {
    border-color: var(--lr-orange) !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25) !important;
}

/* Option Groups & Radio Cards */
.lr-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.lr-options--stacked {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lr-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #f9fafb;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--lr-dark);
    transition: all 0.2s ease;
    user-select: none;
    box-sizing: border-box;
}

.lr-option:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.lr-option:has(input:checked) {
    border-color: var(--lr-orange);
    background-color: var(--lr-orange-soft);
    box-shadow: 0 0 0 1px var(--lr-orange);
}

.lr-options--stacked .lr-option {
    display: flex;
    align-items: flex-start;
    width: 100%;
    padding: 12px 18px;
}

.lr-options--stacked .lr-option input[type="radio"] {
    margin-top: 2px !important;
}

.lr-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lr-option-title {
    font-weight: 600;
    color: var(--lr-dark);
    font-size: 0.95rem;
}

.lr-option-desc {
    color: var(--lr-muted);
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.4;
}

/* Inline Checkboxes (Términos y condiciones, Menor de edad) */
.lr-inline-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--lr-dark);
    margin: 8px 0;
    user-select: none;
}

.lr-inline-check input[type="checkbox"] {
    margin-top: 2px !important;
}

.lr-inline-check span {
    flex: 1;
}

.lr-terms-box {
    margin-top: 8px;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* ==========================================================================
   Helper & Error Messages
   ========================================================================== */
.lr-help {
    color: var(--lr-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.lr-error {
    color: var(--lr-danger);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 4px;
    display: block;
}

.lr-alert {
    margin-bottom: 24px;
    padding: 14px 18px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: var(--lr-danger);
    font-size: 0.9rem;
}

.lr-alert p {
    margin: 0;
}

/* ==========================================================================
   Legal Framework Box
   ========================================================================== */
.lr-legal {
    margin: 20px 0 24px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #64748b;
    border-radius: 8px;
    background: #f8fafc;
    color: #475569;
    font-size: 0.82rem;
    line-height: 1.55;
}

.lr-legal p {
    margin: 0 0 6px;
}

.lr-legal p:last-child {
    margin-bottom: 0;
}

.lr-legal strong {
    color: #1e293b;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */
.lr-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 24px;
    border: 0;
    border-radius: 8px;
    background: var(--lr-orange);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
    transition: all 0.2s ease;
}

.lr-submit:hover {
    background: var(--lr-orange-hover);
    color: #fff;
    box-shadow: 0 6px 18px rgba(234, 88, 12, 0.45);
}

.lr-submit:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

/* ==========================================================================
   Confirmation Page
   ========================================================================== */
.lr-confirmation {
    max-width: 640px;
    text-align: center;
    padding: 48px 32px;
}

.lr-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #dcfce7;
    color: #16a34a;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.lr-confirmation-number {
    margin: 16px 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--lr-orange);
    letter-spacing: 0.04em;
}

.lr-secondary-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--lr-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.lr-secondary-link:hover {
    color: var(--lr-orange);
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 767px) {
    .lr-main {
        padding: 20px 12px 48px;
    }

    .lr-card {
        padding: 24px 18px;
        border-radius: 12px;
    }

    .lr-grid {
        grid-template-columns: 1fr;
    }

    .lr-topbar {
        padding: 12px 16px;
    }

    .lr-logo {
        height: 32px;
    }

    .lr-provider {
        grid-template-columns: 1fr;
        padding: 12px 14px;
    }

    .lr-option {
        width: 100%;
    }
}
