/* ============================================
   TEKLI THEME - LIGHT MODE
   Premium White Theme System
   ============================================ */

.tekli-theme {
    /* CSS Variables - Single Source of Truth */
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
    --shadow-sm: 0 2px 8px rgba(17, 24, 39, 0.04);
    --shadow-lg: 0 16px 48px rgba(17, 24, 39, 0.12);
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

/* ============================================
   GLOBAL BODY & HTML
   ============================================ */

.tekli-theme body,
.tekli-theme {
    background: var(--bg) !important;
    color: var(--text) !important;
}

.tekli-theme html {
    background: var(--bg) !important;
}

/* ============================================
   SECURITY OVERRIDES - Dark classes become light
   ============================================ */

.tekli-theme .bg-dark,
.tekli-theme .bg-black,
.tekli-theme .bg-secondary {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.tekli-theme .text-white {
    color: var(--text) !important;
}

/* Exception: bg-primary sections should have white text */
.tekli-theme section.bg-primary .text-white {
    color: #ffffff !important;
}

.tekli-theme .navbar-dark {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.tekli-theme .navbar-dark .navbar-nav .nav-link {
    color: var(--text) !important;
}

.tekli-theme .navbar-dark .navbar-nav .nav-link:hover {
    color: var(--primary) !important;
}

.tekli-theme .footer-dark,
.tekli-theme footer.bg-dark {
    background: var(--bg) !important;
    color: var(--text) !important;
    border-top: 1px solid var(--border);
}

.tekli-theme footer .text-light,
.tekli-theme footer .text-white {
    color: var(--text) !important;
}

.tekli-theme footer .text-muted {
    color: var(--muted) !important;
}

.tekli-theme footer a {
    color: var(--text) !important;
}

.tekli-theme footer a:hover {
    color: var(--primary) !important;
}

/* ============================================
   CARDS & SURFACES
   ============================================ */

.tekli-theme .card,
.tekli-theme .panel,
.tekli-theme .box {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    border-radius: 14px !important;
    color: var(--text) !important;
}

.tekli-theme .card-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.tekli-theme .card-body {
    background: var(--surface) !important;
    color: var(--text) !important;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */

.tekli-theme .form-control,
.tekli-theme input:not([type="checkbox"]):not([type="radio"]),
.tekli-theme select,
.tekli-theme textarea {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
}

.tekli-theme .form-control:focus,
.tekli-theme input:focus,
.tekli-theme select:focus,
.tekli-theme textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
}

.tekli-theme .form-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 5l6 6 6-6'/%3e%3c/svg%3e") !important;
}

.tekli-theme .form-label {
    color: var(--text) !important;
    font-weight: 500 !important;
}

/* ============================================
   FORM CHECK (RADIO & CHECKBOX) - PREMIUM
   ============================================ */

.tekli-theme .form-check {
    display: flex !important;
    align-items: flex-start !important;
    padding: 1.25rem !important;
    border: 2px solid var(--border) !important;
    border-radius: 10px !important;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    background: var(--surface) !important;
    cursor: pointer;
    gap: 0.75rem;
}

.tekli-theme .form-check:hover {
    border-color: var(--primary) !important;
    background: #f8f9ff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.tekli-theme .form-check-input {
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin: 0 !important;
    margin-top: 0.125rem !important;
    flex-shrink: 0 !important;
    border: 2px solid var(--border) !important;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start !important;
}

/* Radio Button Styling */
.tekli-theme .form-check-input[type="radio"] {
    border-radius: 50% !important;
    background-color: var(--surface) !important;
}

.tekli-theme .form-check-input[type="radio"]:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e") !important;
}

.tekli-theme .form-check-input[type="radio"]:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
}

/* Checkbox Styling */
.tekli-theme .form-check-input[type="checkbox"] {
    border-radius: 4px !important;
    background-color: var(--surface) !important;
}

.tekli-theme .form-check-input[type="checkbox"]:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
}

.tekli-theme .form-check-input[type="checkbox"]:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25) !important;
}

.tekli-theme .form-check-label {
    color: var(--text) !important;
    cursor: pointer;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.6 !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem;
}

.tekli-theme .form-check-label strong {
    color: var(--text) !important;
    font-weight: 600;
}

.tekli-theme .form-check-label .text-muted {
    color: var(--muted) !important;
}

/* Active/Selected Payment Method */
.tekli-theme .form-check-input:checked ~ .form-check-label {
    color: var(--text) !important;
}

.tekli-theme .form-check-input:checked ~ .form-check-label strong {
    color: var(--primary) !important;
}

/* Payment Method Card - Enhanced */
.tekli-theme .checkout-form .form-check {
    display: flex !important;
    align-items: flex-start !important;
    padding: 1.5rem !important;
    border: 2px solid var(--border) !important;
    gap: 1rem !important;
}

.tekli-theme .checkout-form .form-check-input {
    margin-top: 0.125rem !important;
    flex-shrink: 0 !important;
}

.tekli-theme .checkout-form .form-check-label {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.tekli-theme .checkout-form .form-check-label strong {
    display: block !important;
    font-size: 1.05rem !important;
    margin-bottom: 0.25rem !important;
}

.tekli-theme .checkout-form .form-check-label .text-muted {
    display: block !important;
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.tekli-theme .checkout-form .form-check-input:checked ~ .form-check-label {
    color: var(--text) !important;
}

.tekli-theme .checkout-form .form-check:has(.form-check-input:checked) {
    border-color: var(--primary) !important;
    background: #f0f4ff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15) !important;
}

/* Terms Checkbox - Special Styling */
.tekli-theme .form-check#terms_accepted,
.tekli-theme .form-check:has(#terms_accepted) {
    display: flex !important;
    align-items: flex-start !important;
    padding: 1rem 1.25rem !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    gap: 0.75rem !important;
}

.tekli-theme .form-check#terms_accepted:hover,
.tekli-theme .form-check:has(#terms_accepted):hover {
    border-color: var(--primary) !important;
    background: #f8f9ff !important;
}

.tekli-theme .form-check#terms_accepted .form-check-input,
.tekli-theme .form-check:has(#terms_accepted) .form-check-input {
    margin-top: 0.125rem !important;
    flex-shrink: 0 !important;
}

.tekli-theme .form-check#terms_accepted .form-check-input:checked,
.tekli-theme .form-check:has(#terms_accepted) .form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.tekli-theme .form-check#terms_accepted .form-check-label,
.tekli-theme .form-check:has(#terms_accepted) .form-check-label {
    flex: 1 !important;
    line-height: 1.6 !important;
    display: block !important;
}

.tekli-theme .form-check#terms_accepted .form-check-label a,
.tekli-theme .form-check:has(#terms_accepted) .form-check-label a {
    color: var(--primary) !important;
    text-decoration: none;
    font-weight: 500;
    display: inline !important;
}

.tekli-theme .form-check#terms_accepted .form-check-label a:hover,
.tekli-theme .form-check:has(#terms_accepted) .form-check-label a:hover {
    text-decoration: underline;
}

/* Marketing Consent Checkbox */
.tekli-theme .form-check:has(#marketing_consent) {
    display: flex !important;
    align-items: flex-start !important;
    padding: 1rem 1.25rem !important;
    gap: 0.75rem !important;
    border: none !important;
    background: transparent !important;
}

.tekli-theme .form-check:has(#marketing_consent) .form-check-input {
    margin-top: 0.125rem !important;
    flex-shrink: 0 !important;
}

.tekli-theme .form-check:has(#marketing_consent) .form-check-label {
    flex: 1 !important;
    line-height: 1.6 !important;
}

/* ============================================
   CHECKOUT PAGE - PREMIUM WHITE
   ============================================ */

.tekli-theme .checkout-steps {
    background: transparent !important;
    margin-bottom: 2.5rem;
}

.tekli-theme .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 80px;
}

.tekli-theme .step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface) !important;
    border: 2px solid var(--border) !important;
    color: var(--muted) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.tekli-theme .step.active .step-number {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.tekli-theme .step-title {
    font-size: 0.875rem;
    color: var(--muted) !important;
    font-weight: 500;
}

.tekli-theme .step.active .step-title {
    color: var(--primary) !important;
    font-weight: 600;
}

.tekli-theme .step-line {
    width: 60px;
    height: 2px;
    background: var(--border) !important;
    margin: 0 1rem;
}

.tekli-theme .step.active ~ .step-line {
    background: var(--primary) !important;
}

/* Checkout Form Cards */
.tekli-theme .checkout-form .card {
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s ease;
}

.tekli-theme .checkout-form .card:hover {
    box-shadow: var(--shadow) !important;
}

.tekli-theme .checkout-form .card-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.25rem 1.5rem;
}

.tekli-theme .checkout-form .card-header h5 {
    color: var(--text) !important;
    font-weight: 600;
    margin: 0;
}

/* Order Summary Sidebar */
.tekli-theme .order-summary {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
    border-radius: 14px !important;
}

.tekli-theme .order-summary .card-header {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    padding: 1.5rem;
}

.tekli-theme .order-summary .card-body {
    background: var(--surface) !important;
    padding: 1.5rem;
}

.tekli-theme .price-breakdown {
    color: var(--text) !important;
}

.tekli-theme .price-breakdown hr {
    border-color: var(--border) !important;
    opacity: 1;
}

/* ============================================
   BUTTONS
   ============================================ */

.tekli-theme .btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
    box-shadow: var(--shadow-sm) !important;
    transition: all 0.2s ease;
}

.tekli-theme .btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    box-shadow: var(--shadow) !important;
    transform: translateY(-1px);
}

.tekli-theme .btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
}

.tekli-theme .btn-outline-primary:hover {
    background: var(--primary) !important;
    color: #ffffff !important;
}

/* ============================================
   SECTIONS & CONTAINERS
   ============================================ */

.tekli-theme section:not(.bg-primary):not(.bg-dark) {
    background: var(--bg) !important;
    color: var(--text) !important;
}

/* Primary section - Keep primary color but ensure text is readable */
.tekli-theme section.bg-primary {
    background: var(--primary) !important;
    color: #ffffff !important;
}

.tekli-theme section.bg-primary .text-white,
.tekli-theme section.bg-primary h1,
.tekli-theme section.bg-primary h2,
.tekli-theme section.bg-primary h3,
.tekli-theme section.bg-primary h4,
.tekli-theme section.bg-primary h5,
.tekli-theme section.bg-primary h6,
.tekli-theme section.bg-primary p {
    color: #ffffff !important;
}

.tekli-theme .container {
    background: var(--bg) !important;
}

/* Exception: bg-primary sections should have transparent container */
.tekli-theme section.bg-primary .container {
    background: transparent !important;
}

.tekli-theme main {
    background: var(--bg) !important;
    color: var(--text) !important;
}

/* ============================================
   NAVBAR
   ============================================ */

.tekli-theme .navbar {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: var(--shadow-sm) !important;
}

.tekli-theme .navbar-brand {
    color: var(--text) !important;
}

.tekli-theme .navbar .nav-link {
    color: var(--text) !important;
}

.tekli-theme .navbar .nav-link:hover {
    color: var(--primary) !important;
}

/* ============================================
   FOOTER - PREMIUM WHITE
   ============================================ */

.tekli-theme footer {
    background: var(--bg) !important;
    color: var(--text) !important;
    border-top: 1px solid var(--border) !important;
    margin-top: 4rem;
}

.tekli-theme footer h5,
.tekli-theme footer h6 {
    color: var(--text) !important;
    font-weight: 600;
}

.tekli-theme footer .text-muted {
    color: var(--muted) !important;
}

.tekli-theme footer a {
    color: var(--text) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tekli-theme footer a:hover {
    color: var(--primary) !important;
    text-decoration: underline;
}

.tekli-theme footer .btn-outline-light {
    border-color: var(--border) !important;
    color: var(--text) !important;
    background: transparent !important;
}

.tekli-theme footer .btn-outline-light:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* ============================================
   ACCORDION
   ============================================ */

.tekli-theme .accordion-item {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    margin-bottom: 0.5rem;
}

.tekli-theme .accordion-button {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: none !important;
    box-shadow: none !important;
}

.tekli-theme .accordion-button:not(.collapsed) {
    background: var(--surface) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}

.tekli-theme .accordion-button:hover {
    background: #f9fafb !important;
}

.tekli-theme .accordion-body {
    background: var(--surface) !important;
    color: var(--text) !important;
}

/* ============================================
   TABLES
   ============================================ */

.tekli-theme .table {
    background: var(--surface) !important;
    color: var(--text) !important;
}

.tekli-theme .table th {
    background: #f9fafb !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

.tekli-theme .table td {
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* ============================================
   ALERTS & MESSAGES
   ============================================ */

.tekli-theme .alert {
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
}

.tekli-theme .alert-success {
    background: #f0fdf4 !important;
    border-color: var(--success) !important;
    color: #166534 !important;
}

.tekli-theme .alert-danger {
    background: #fef2f2 !important;
    border-color: var(--danger) !important;
    color: #991b1b !important;
}

/* ============================================
   UTILITIES
   ============================================ */

.tekli-theme .text-muted {
    color: var(--muted) !important;
}

.tekli-theme .bg-light {
    background: #f9fafb !important;
}

.tekli-theme hr {
    border-color: var(--border) !important;
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .tekli-theme .step-number {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
    
    .tekli-theme .step-line {
        width: 30px;
    }
    
    .tekli-theme .checkout-form .card {
        margin-bottom: 1rem;
    }
    
    /* Form Check Responsive */
    .tekli-theme .form-check {
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    
    .tekli-theme .checkout-form .form-check {
        padding: 1.25rem !important;
        gap: 0.875rem !important;
    }
    
    .tekli-theme .form-check-input {
        width: 1.125rem !important;
        height: 1.125rem !important;
        margin-top: 0.125rem !important;
    }
    
    .tekli-theme .form-check-label {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }
    
    .tekli-theme .checkout-form .form-check-label strong {
        font-size: 1rem !important;
    }
    
    .tekli-theme .checkout-form .form-check-label .text-muted {
        font-size: 0.85rem !important;
    }
}

@media (max-width: 576px) {
    .tekli-theme .form-check {
        padding: 0.875rem !important;
        gap: 0.625rem !important;
    }
    
    .tekli-theme .checkout-form .form-check {
        padding: 1rem !important;
        gap: 0.75rem !important;
    }
    
    .tekli-theme .form-check-input {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .tekli-theme .form-check-label {
        font-size: 0.9rem !important;
    }
    
    .tekli-theme .checkout-form .form-check-label strong {
        font-size: 0.95rem !important;
    }
    
    .tekli-theme .checkout-form .form-check-label .text-muted {
        font-size: 0.8rem !important;
    }
}
