* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: #1e293b;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 40px;
    background: white;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-brand img {
    height: 45px;
}

.header-brand span {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(to right, #047857, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    gap: 30px;
}

.combined-card {
    display: flex;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f4f8;
    max-width: 1200px;
    width: 100%;
    min-height: 600px;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .combined-card {
        flex-direction: row;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        color: #f1f5f9;
    }

    .combined-card {
        background: #1e293b;
        border-color: #334155;
        box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    }

    .header-brand {
        background: #0f172a;
        border-bottom-color: #334155;
    }

    .payment-side {
        background: #1e293b;
        color: #f1f5f9;
    }

    input,
    textarea,
    select {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    input::placeholder,
    textarea::placeholder {
        color: #64748b !important;
    }

    input:focus,
    textarea:focus,
    select:focus {
        border-color: #10b981 !important;
        box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    }

    .buyer-info-section {
        background: #0f172a !important;
        border: 1px solid #334155 !important;
    }

    .buyer-info-section label {
        color: #cbd5e1 !important;
    }

    .documents-section {
        background: #0f172a !important;
        border: 1px solid #334155 !important;
    }

    .documents-section label {
        color: #cbd5e1 !important;
    }

    .installment-select {
        background: #0f172a !important;
        border-color: #334155 !important;
        color: #f1f5f9 !important;
    }

    .feature-badge {
        background: #334155;
        color: #cbd5e1;
        border-color: #475569;
    }

    .late-fee-warning {
        background: #7f1d1d;
        border-color: #dc2626;
    }

    .installment-calculator {
        background: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }

    .product-info {
        background: rgba(15, 23, 42, 0.95);
        color: #f1f5f9;
    }

    .price-overlay {
        background: rgba(4, 120, 87, 0.85);
        border-color: #059669;
    }

    .security-footer {
        color: #cbd5e1 !important;
        border-top-color: #334155 !important;
    }

    .security-footer span {
        color: #cbd5e1 !important;
    }

    .page-footer {
        background: #0f172a !important;
        border-top-color: #334155 !important;
        color: #cbd5e1 !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .main-container {
        padding: 12px;
        gap: 0;
        align-items: stretch;
    }

    .combined-card {
        min-height: auto;
        border-radius: 20px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05);
        display: flex;
        flex-direction: column;
    }

    .product-side {
        min-height: auto;
        max-height: none;
        order: -1;
        flex-shrink: 0;
        overflow: visible;
    }

    .payment-side {
        padding: 16px;
        flex: 1;
        overflow-y: auto;
        max-height: none;
    }

    .product-overlay {
        padding: 20px;
        position: static;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        justify-content: flex-start;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    .product-info {
        background: none;
        padding: 12px;
        border-radius: 0;
        backdrop-filter: none;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    .product-name {
        font-size: 20px;
        margin-bottom: 8px;
    }

    .product-description {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .price-overlay {
        padding: 12px;
        margin-top: 12px;
    }

    .price-overlay .price {
        font-size: 12px;
    }

    .currency {
        font-size: 18px;
    }

    .feature-badges {
        gap: 5px;
        margin-bottom: 12px;
    }

    .feature-badge {
        font-size: 10px;
        padding: 5px 8px;
    }

    .installment-section {
        padding: 12px;
        margin-bottom: 12px;
    }

    .payment-method-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .payment-method-card {
        padding: 10px;
        border-radius: 10px;
        font-size: 12px;
    }

    .payment-button {
        padding: 14px;
        font-size: 14px;
        margin-top: 10px;
    }

    .buyer-info-section {
        margin-bottom: 12px;
        padding: 10px;
    }

    .buyer-info-section input,
    .buyer-info-section textarea {
        padding: 8px !important;
        font-size: 14px;
    }

    .seller-info {
        margin-bottom: 6px;
    }

    .seller-info .w-10 {
        width: 28px;
        height: 28px;
    }

    .grid.grid-cols-1 {
        gap: 3px;
    }
}

@media (max-width: 480px) {
    .header-brand {
        padding: 15px 20px;
    }

    .header-brand img {
        height: 35px;
    }

    .header-brand span {
        font-size: 20px;
    }

    .main-container {
        padding: 10px;
    }

    .combined-card {
        border-radius: 16px;
    }

    .payment-side {
        padding: 15px;
    }

    .product-name {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .product-description {
        font-size: 12px;
        margin-bottom: 15px;
    }

    .price-overlay .price {
        font-size: 16px;
    }

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

    .installment-section input,
    .installment-section select {
        font-size: 14px;
    }
}

.product-side {
    flex: 1.2;
    position: relative;
    overflow: visible;
    /* min-height: 500px; */
    height: auto;
}

.product-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    color: white;
    min-height: 100%;
    height: auto;
    overflow: visible;
}

.product-info {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    height: auto;
    min-height: fit-content;
    overflow: visible;
}

.product-name {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 15px;
    line-height: 1.2;
}

.product-description {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0.95;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#productDescContainer {
    width: 100%;
}

@media (max-width: 768px) {
    #productDescContainer {
        max-height: 200px;
        overflow-y: auto;
        padding-right: 8px;
    }

    #fullText {
        display: block !important;
    }
}

#toggleDesc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

#toggleDesc:hover {
    color: #059669;
    transform: translateX(2px);
}

#toggleIcon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 12px;
}

#shortText,
#fullText {
    transition: display 0.2s ease;
}

.price-overlay {
    background: rgba(4, 120, 87, 0.9);
    border-radius: 16px;
    padding: 12px;
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.price-label {
    font-size: 16px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.price-overlay .price {
    font-size: 16px;
    font-weight: 900;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.currency {
    font-size: 12px;
    font-weight: 700;
    opacity: 0.9;
}

.payment-side {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    color: #475569;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.feature-badge.late-fee {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.feature-badge.installment {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.stat-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card:hover {
    border-color: #047857;
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.08);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.5px;
}

.stat-card-header i {
    color: #047857;
    font-size: 14px;
}

.stat-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
}

.stat-card-note {
    font-size: 12px;
    color: #9ca3af;
}

.stat-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-badge-green {
    background: #dbeafe;
    color: #0369a1;
}

.stat-badge-blue {
    background: #dbeafe;
    color: #0369a1;
}

.stat-badge-orange {
    background: #fed7aa;
    color: #92400e;
}

.stat-badge-purple {
    background: #e9d5ff;
    color: #6b21a8;
}

@media (prefers-color-scheme: dark) {
    .stat-card {
        background: #1f2937;
        border-color: #374151;
    }

    .stat-card:hover {
        border-color: #10b981;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    }

    .stat-card-header {
        color: #d1d5db;
    }

    .stat-card-header i {
        color: #10b981;
    }

    .stat-card-value {
        color: #f9fafb;
    }

    .stat-card-note {
        color: #9ca3af;
    }

    .stat-badge-green {
        background: #064e3b;
        color: #6ee7b7;
    }

    .stat-badge-blue {
        background: #0c2d3d;
        color: #67e8f9;
    }

    .stat-badge-orange {
        background: #78350f;
        color: #fdba74;
    }

    .stat-badge-purple {
        background: #4c1d95;
        color: #d8b4fe;
    }
}

.late-fee-warning {
    background: #fef2f2;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #fecaca;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        border-color: #fecaca;
    }

    50% {
        border-color: #fca5a5;
    }

    100% {
        border-color: #fecaca;
    }
}

.late-fee-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.installment-section {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
}

.installment-select {
    width: 100%;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    color: #1e293b;
    font-size: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.installment-select:focus {
    outline: none;
    border-color: #047857;
    box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.1);
}

.installment-calculator {
    background: #ecfdf5;
    border-radius: 12px;
    padding: 15px;
    font-size: 14px;
    color: #065f46;
}

.wallets-section {
    margin-bottom: 25px;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.payment-method-card {
    background: white;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

.payment-method-card:hover {
    border-color: #047857;
    box-shadow: 0 6px 16px rgba(4, 120, 87, 0.12);
    transform: translateY(-2px);
}

.payment-method-card.selected {
    border-color: #047857;
    background: #f0fdf4;
    box-shadow: 0 8px 20px rgba(4, 120, 87, 0.15);
}

.payment-method-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border-radius: 8px;
    color: #047857;
    font-size: 18px;
    transition: all 0.3s ease;
}

.payment-method-card:hover .payment-method-icon {
    background: #dbeafe;
    transform: scale(1.1);
}

.payment-method-card.selected .payment-method-icon {
    background: #dcfce7;
    color: #15803d;
}

.payment-method-content {
    text-align: center;
    flex: 1;
}

.payment-method-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.payment-method-installments {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
    font-weight: 500;
}

.payment-method-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    transition: all 0.3s ease;
}

.payment-method-card.selected .payment-method-check {
    background: #047857;
    border-color: #047857;
    color: white;
}

@media (prefers-color-scheme: dark) {
    .payment-method-card {
        background: #1f2937;
        border-color: #374151;
    }

    .payment-method-card:hover {
        border-color: #10b981;
        box-shadow: 0 6px 16px rgba(16, 185, 129, 0.15);
    }

    .payment-method-card.selected {
        background: #064e3b;
        border-color: #10b981;
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
    }

    .payment-method-icon {
        background: #374151;
        color: #10b981;
    }

    .payment-method-card:hover .payment-method-icon {
        background: #0c2d3d;
    }

    .payment-method-card.selected .payment-method-icon {
        background: #047857;
        color: #dcfce7;
    }

    .payment-method-name {
        color: #f9fafb;
    }

    .payment-method-installments {
        color: #9ca3af;
    }

    .payment-method-check {
        background: #1f2937;
        border-color: #374151;
    }

    .payment-method-card.selected .payment-method-check {
        background: #10b981;
        border-color: #10b981;
    }
}

#fillWhatsappBtn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
}

.payment-button {
    width: 100%;
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
    border: none;
    padding: 20px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
    box-shadow: 0 10px 30px rgba(4, 120, 87, 0.2);
}

.payment-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.payment-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(4, 120, 87, 0.3);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    max-width: 400px;
}

.toast.success {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
}

.toast.error {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

.toast.warning {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 450px;
    padding: 40px;
    transform: translateY(-20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    border: 1px solid #e2e8f0;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    color: #1e293b;
}

@media (prefers-color-scheme: dark) {
    .modal {
        background: #1e293b;
        border-color: #334155;
        color: #f1f5f9;
    }
}

.dark .modal {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .modal h2,
.dark .modal h3 {
    color: #f1f5f9;
}

.dark .modal p {
    color: #cbd5e1;
}

.dark .modal label {
    color: #cbd5e1;
}

.dark .modal input,
.dark .modal textarea,
.dark .modal select {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

.dark .modal input:focus,
.dark .modal textarea:focus,
.dark .modal select:focus {
    background: #0f172a;
    color: #f1f5f9;
    border-color: #059669;
}

.dark .modal button {
    color: white;
}

.dark #codeError {
    color: #fca5a5;
}

.dark .modal .text-gray-500 {
    color: #94a3b8;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #047857;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

.dark .loader {
    border-color: #334155;
    border-top-color: #10b981;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-state {
    text-align: center;
    padding: 60px 40px;
}

.error-icon {
    font-size: 64px;
    color: #dc2626;
    margin-bottom: 20px;
}

.error-title {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.error-message {
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .combined-card {
        flex-direction: column;
        max-width: 600px;
        min-height: auto;
    }

    .product-side {
        min-height: 400px;
    }

    .product-name {
        font-size: 32px;
    }

    .payment-side {
        padding: 30px;
    }
}

@media (max-width: 640px) {
    .header-brand {
        padding: 15px 20px;
    }

    .header-brand span {
        font-size: 22px;
    }

    .main-container {
        padding: 15px;
    }

    .product-name {
        font-size: 24px;
    }

    .product-description {
        font-size: 16px;
    }

    .price-overlay .price {
        font-size: 16px;
    }

    .wallet-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        padding: 30px 20px;
    }
}

/* Field Validation Styles */
.field-error {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.field-error-message {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Toast Animation */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: #1e293b;
    }

    ::-webkit-scrollbar-thumb {
        background: #475569;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #64748b;
    }
}
