/* Request Page Specific Styles */

/* Base Layout overrides for Request Page */
body:not(.sidebar-mode) .request-main {
    display: block; /* Single column flow */
    flex: 1; /* Grow to fill flex parent */
    width: 100%; /* Ensure full width */
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem !important;
    height: 100%;
    overflow-y: auto; /* Scrollable */
}

/* Header & Titles */
.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
.request-header h2 {
    font-size: 1.8rem;
    color: var(--secondary);
    font-weight: 800;
}

/* Form Container */
#checkout-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Form Sections (Cards) */
.form-section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
}
.form-section:hover {
    box-shadow: var(--shadow-hover);
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    color: var(--secondary);
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-light);
}
.section-heading i {
    color: var(--primary);
}

/* Form Inputs */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    background: #fff;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(132, 22, 23, 0.1); /* Crimson focus ring */
}

/* Chart Field Specific Styles */
.full-width-box {
    grid-column: 1 / -1;
}

.chart-fields-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr); /* Force 7 columns */
    gap: 0.5rem; /* Reduced gap */
}

.chart-fields-row .form-group input {
    padding: 0.5rem 0.25rem; /* More compact padding */
    text-align: center;
    width: 100%;
    min-width: 0; /* Allow shrinking below default browser width */
    font-size: 0.9rem;
}

.chart-fields-row .form-group label {
    font-size: 0.75rem; /* Smaller labels */
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .chart-fields-row {
        grid-template-columns: repeat(4, 1fr); /* Break to 2 rows on tablet */
    }
}

@media (max-width: 600px) {
    .chart-fields-row {
        grid-template-columns: repeat(2, 1fr); /* Break to smaller grid on mobile */
    }
}


/* Radio & Checkbox Groups (Segmented Button Style) */
.radio-group {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: fit-content;
}

.radio-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-weight: 600 !important;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
    margin: 0;
}

.radio-label:hover {
    background: #edf2f7;
    color: var(--secondary);
}

/* Hide actual input */
.radio-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Selected State */
.radio-label:has(input[type="radio"]:checked) {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Checkbox "Cards" Style (for Infrastructure/Config) */
.form-group .radio-label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.35rem 0.6rem; /* Even tighter padding */
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 6px;
    width: 100%;
    transition: all 0.2s;
    margin-bottom: 4px; /* Minimal margin */
}

/* Remove the gap from the parent container if it only contains these checkbox labels */
.form-group:has(.radio-label) {
    gap: 2px;
}

.form-group .radio-label:has(input[type="checkbox"]:checked) {
    background: #ebf8ff; /* Light blue tint */
    border-color: #bee3f8;
    color: #2b6cb0;
    font-weight: 700 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.form-group .radio-label:hover:has(input[type="checkbox"]) {
    border-color: #cbd5e0;
    background: #f7fafc;
}

/* Custom Checkbox Indicator */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e0;
    border-radius: 4px;
    margin-right: 0.75rem;
    display: grid;
    place-content: center;
    transition: all 0.2s;
    background: white;
    flex-shrink: 0;
}

input[type="checkbox"]::before {
    content: "\f00c"; /* FontAwesome Check */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.75rem;
    color: white;
    transform: scale(0);
    transition: 0.1s transform ease-in-out;
}

input[type="checkbox"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Device Config Cards */
.device-config-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0; 
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.device-card-header {
    background: white; /* Changed from gray to white */
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--bg-light); /* Consistent with section-heading */
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.device-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
}
.device-vendor {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-light);
    letter-spacing: 0.5px;
    font-weight: 700;
}
.device-price {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}

/* Grid for Device Sections (Max 3 Columns) */
.device-sections-grid {
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Info Boxes (Clean Modern Style) */
.info-box {
    padding: 1.5rem;
    border-radius: 8px;
    background: #ffffff; /* Clean white background */
    border: 1px solid #e2e8f0; /* Subtle border */
    border-top: 4px solid var(--primary); /* Unified crimson accent */
    height: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Remove specific color overrides */
.info-box-blue, .info-box-warm {
    border-top-color: var(--primary);
}

/* Remove colored text from titles inside these boxes to keep it clean */
.info-box .box-title {
    color: var(--secondary) !important;
}
.info-box .box-title i {
    color: inherit; /* Icon matches text */
    opacity: 0.6;
}

.box-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.sub-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
    margin-top: 0;
}
.text-primary { color: #2b6cb0; }
.text-warm { color: #c05621; }

.use-requester-btn {
    background: white;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: all 0.2s;
}
.use-requester-btn:hover {
    background: var(--bg-light);
}

/* Order Summary */
.order-summary {
    margin-top: 3rem;
    margin-bottom: 5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.summary-item label {
    color: var(--text-light);
    font-weight: 500;
}

.summary-item .value {
    color: var(--secondary);
    font-weight: 700;
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, background 0.2s;
}
.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Cart Items Container (Empty State) */
.cart-items-container.empty {
    grid-column: 1 / -1;
    background: white;
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 12px;
    border: 2px dashed var(--border);
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
    .device-sections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .request-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
}
@media (max-width: 768px) {
    body:not(.sidebar-mode) .request-main {
        padding: 1rem !important;
    }
    .device-sections-grid {
        grid-template-columns: 1fr;
    }
    .form-row { grid-template-columns: 1fr; }
}
/* Validation Styles */
.form-group input.invalid, 
.form-group select.invalid, 
.form-group textarea.invalid {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.error-msg {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-2px); }
    to { opacity: 1; transform: translateY(0); }
}
