/* DA-Software Mini-Shop - Main Stylesheet */
/* Blue Theme - Color: #1E3466 */

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background: #f0f2f5;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */

.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border: 2px solid transparent;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: #f8f9fa;
}

.lang-btn.active {
    background: #1E3466;
    color: white;
    border-color: #1E3466;
}

.flag-icon {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 60px;
}

.header {
    background: #1E3466;
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 600;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.form-container {
    padding: 40px;
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    margin-bottom: 35px;
}

.section-title {
    font-size: 20px;
    color: #1E3466;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1E3466;
    font-weight: 600;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

label.required::after {
    content: " *";
    color: #e74c3c;
}

input[type="text"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1E3466;
    box-shadow: 0 0 0 3px rgba(30, 52, 102, 0.1);
}

/* ============================================
   PRODUCT SELECTION
   ============================================ */

.product-checkbox {
    display: flex;
    align-items: flex-start;
    padding: 18px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.product-checkbox:hover {
    background: #e9ecef;
    border-color: #1E3466;
}

.product-checkbox input[type="checkbox"] {
    margin-right: 15px;
    margin-top: 5px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1E3466;
}

.product-info {
    flex: 1;
}

.product-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.5;
}

.product-price {
    font-size: 20px;
    color: #1E3466;
    font-weight: 700;
}

.price-note {
    font-size: 11px;
    color: #999;
    font-style: italic;
    margin-top: 3px;
}

/* ============================================
   TERMS AND CONDITIONS CHECKBOX
   ============================================ */

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    cursor: pointer;
}

.terms-checkbox:hover {
    background: #e9ecef;
    border-color: #1E3466;
}

.terms-checkbox.checked {
    background: #e7f0ff;
    border-color: #1E3466;
}

.terms-checkbox.error {
    background: #ffe7e7;
    border-color: #e74c3c;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.terms-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    min-width: 22px;
    margin-top: 3px;
    cursor: pointer;
    accent-color: #1E3466;
    flex-shrink: 0;
}

.terms-label {
    flex: 1;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
    margin: 0;
    font-weight: 400;
}

.terms-label a {
    color: #1E3466;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.terms-label a:hover {
    border-bottom-color: #1E3466;
}

.terms-checkbox.checked .terms-label {
    color: #1E3466;
    font-weight: 500;
}

.terms-checkbox.error .terms-label {
    color: #e74c3c;
}

/* ============================================
   PAYMENT METHODS
   ============================================ */

.payment-method {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.payment-method:hover {
    background: #e9ecef;
}

.payment-method.selected {
    background: #e7f0ff;
    border-color: #1E3466;
}

.payment-method input[type="radio"] {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #1E3466;
}

.payment-label {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

/* ============================================
   DISCOUNT CODE SECTION
   ============================================ */

.discount-code-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.discount-code-input {
    flex: 1;
}

.discount-btn {
    padding: 12px 25px;
    background: #1E3466;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.discount-btn:hover {
    background: #152847;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(30, 52, 102, 0.2);
}

.discount-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.discount-message {
    margin-top: 10px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.discount-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.discount-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.discount-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-top: 10px;
}

.discount-applied-text {
    color: #155724;
    font-weight: 600;
}

.remove-discount-btn {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.remove-discount-btn:hover {
    background: #c82333;
}

/* ============================================
   ORDER SUMMARY
   ============================================ */

.order-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    border: 2px solid #e9ecef;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #555;
    font-size: 15px;
}

.summary-row.discount {
    color: #28a745;
    font-weight: 600;
}

.summary-row.total {
    font-size: 22px;
    font-weight: 700;
    color: #1E3466;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    margin-top: 10px;
}

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

.submit-btn {
    width: 100%;
    padding: 18px;
    background: #1E3466;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.submit-btn:hover:not(:disabled) {
    background: #152847;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 52, 102, 0.3);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ============================================
   GRID LAYOUTS
   ============================================ */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 15px 40px;
    background: #1E3466;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #152847;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 52, 102, 0.3);
}

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin-top: 80px;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .language-switcher {
        top: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .lang-btn {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .discount-code-group {
        flex-direction: column;
    }
    
    .discount-btn {
        width: 100%;
    }
    
    .summary-row.total {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .section-title {
        font-size: 18px;
    }
    
    .product-name {
        font-size: 15px;
    }
    
    .product-price {
        font-size: 18px;
    }
}

/* ============================================
   PREPAYMENT CONFIRMATION PAGE
   ============================================ */

/* Prepayment page uses centered layout */
body.prepayment-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.prepayment-page .container {
    margin-top: 0;
    max-width: 700px;
}

/* Content wrapper for prepayment page */
.content {
    padding: 40px;
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
}

/* Button for prepayment page */
.btn {
    display: inline-block;
    padding: 15px 40px;
    background: #1E3466;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn:hover {
    background: #152847;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 52, 102, 0.3);
}

/* Success Icon */
.success-icon {
    width: 80px;
    height: 80px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-icon::after {
    content: "✓";
    color: white;
    font-size: 50px;
    font-weight: bold;
}

/* Info Text */
.info-text {
    color: #666;
    line-height: 1.6;
    margin: 20px 0;
    font-size: 15px;
    text-align: center;
}

/* Order Number Box */
.order-number {
    background: #e7f0ff;
    padding: 20px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: center;
    border: 2px solid #1E3466;
}

.order-number-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.order-number-value {
    font-size: 24px;
    font-weight: 700;
    color: #1E3466;
    font-family: monospace;
}

/* Bank Details Section */
.bank-details {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
    border: 1px solid #e9ecef;
}

.bank-details h2 {
    color: #1E3466;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    text-align: center;
}

.bank-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.bank-row:last-child {
    border-bottom: none;
}

.bank-label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.bank-value {
    color: #333;
    font-family: monospace;
    font-size: 14px;
    text-align: right;
}

.bank-row.highlight .bank-value {
    color: #1E3466;
    font-weight: 700;
    font-size: 16px;
}

/* Amount Box */
.amount-box {
    background: #1E3466;
    color: white;
    padding: 25px;
    border-radius: 8px;
    text-align: center;
    margin: 30px 0;
}

.amount-label {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.amount-value {
    font-size: 36px;
    font-weight: 700;
}

/* Email Notice */
.email-notice {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.email-notice p {
    color: #0d47a1;
    margin: 0;
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    border-top: 1px solid #e9ecef;
    color: #666;
    font-size: 13px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Prepayment Page Responsive */
@media (max-width: 768px) {
    .bank-details {
        padding: 20px;
    }
    
    .bank-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .bank-value {
        text-align: left;
    }
    
    .amount-value {
        font-size: 28px;
    }
}

/* ============================================
   STRIPE PAYMENT PAGE
   ============================================ */

/* Stripe page uses centered layout */
body.stripe-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.stripe-page .container {
    margin-top: 0;
    min-width: 500px;
    max-width: 700px;
}

body.stripe-page .header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

body.stripe-page .header p {
    font-size: 14px;
}

/* Order Info Section */
.order-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin: 0 0 30px 0;
    border: 1px solid #e9ecef;
}

.order-info h2 {
    color: #1E3466;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: #555;
    font-size: 15px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row.total {
    font-size: 22px;
    font-weight: 700;
    color: #1E3466;
    padding-top: 15px;
    border-top: 2px solid #ddd;
    margin-top: 10px;
}

/* Items List */
.items-list {
    margin: 15px 0;
}

.item {
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
    color: #555;
    font-size: 14px;
}

.item:last-child {
    border-bottom: none;
}

/* Payment Section */
.payment-section {
    margin: 30px 0;
}

.payment-section h3 {
    color: #1E3466;
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Stripe Card Element */
#card-element {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: border-color 0.3s;
}

#card-element.StripeElement--focus {
    border-color: #1E3466;
}

#card-errors {
    color: #dc3545;
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1E3466;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.loading-text {
    color: #666;
    font-size: 14px;
}

/* Secure Notice */
.secure-notice {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    font-size: 13px;
    color: #0d47a1;
    text-align: center;
}

.secure-notice::before {
    content: "🔒 ";
}

/* Stripe Page Responsive */
@media (max-width: 768px) {
    body.stripe-page .header {
        padding: 20px;
    }
    
    body.stripe-page .header h1 {
        font-size: 22px;
    }
    
    .order-info {
        padding: 20px;
    }
}

/* ============================================
   PAYMENT SUCCESS PAGE
   ============================================ */

/* Success page uses centered layout */
body.success-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.success-page .container {
    margin-top: 0;
    max-width: 700px;
}

body.success-page .success-icon {
    width: 100px;
    height: 100px;
    background: #4CAF50;
    font-size: 60px;
}

body.success-page .header h1 {
    font-size: 32px;
}

/* Order Number Box (larger for success page) */
body.success-page .order-number {
    padding: 25px;
}

.order-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.order-value {
    font-weight: 700;
    color: #1E3466;
    font-size: 28px;
    font-family: monospace;
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 20px;
    text-align: left;
    margin: 30px 0;
    border-radius: 4px;
}

.info-box h3 {
    color: #1976D2;
    margin-bottom: 10px;
    font-size: 18px;
    font-weight: 600;
}

.info-box p {
    color: #0d47a1;
    line-height: 1.6;
    margin: 0;
    font-size: 15px;
}

/* Success Message */
.success-message {
    color: #666;
    line-height: 1.8;
    margin: 20px 0;
    font-size: 15px;
    text-align: center;
}

/* Features Grid */
.features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.feature {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    border: 1px solid #e9ecef;
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: #1E3466;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}

.feature-text {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

.feature-text strong {
    color: #1E3466;
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

/* Success Page Responsive */
@media (max-width: 768px) {
    body.success-page .header {
        padding: 30px 20px;
    }
    
    body.success-page .header h1 {
        font-size: 26px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .order-value {
        font-size: 22px;
    }
}

/* ============================================
   PAYMENT ERROR PAGE
   ============================================ */

/* Error page uses centered layout */
body.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

body.error-page .container {
    margin-top: 0;
    max-width: 700px;
}

/* Red header for error page */
body.error-page .header {
    background: #dc3545;
}

body.error-page .header h1 {
    font-size: 32px;
}

/* Error Icon */
.error-icon {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.error-icon::after {
    content: "✕";
    color: #dc3545;
    font-size: 60px;
    font-weight: bold;
}

/* Error Message */
.error-message {
    color: #666;
    line-height: 1.8;
    margin: 20px 0;
    text-align: center;
    font-size: 15px;
}

/* Help Text Box (reuse from other pages, but add specificity if needed) */
.help-text {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 20px;
    margin: 30px 0;
    border-radius: 4px;
}

.help-text p {
    color: #0d47a1;
    line-height: 1.6;
    margin: 0;
    font-size: 15px;
}

/* Info Box with Yellow Warning (overrides default if needed) */
body.error-page .info-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

body.error-page .info-box h3 {
    color: #856404;
}

body.error-page .info-box ul {
    color: #856404;
    margin-left: 20px;
    line-height: 1.8;
}

body.error-page .info-box li {
    margin: 8px 0;
    font-size: 14px;
}

/* Button Group */
.btn-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Secondary Button */
.btn-secondary {
    background: #6c757d;
    display: inline-block;
    padding: 15px 30px;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Contact Info Box */
.contact-info {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.contact-info p {
    color: #555;
    margin: 5px 0;
    font-size: 14px;
}

.contact-info strong {
    color: #1E3466;
    font-size: 16px;
}

/* Error Page Responsive */
@media (max-width: 768px) {
    body.error-page .header {
        padding: 30px 20px;
    }
    
    body.error-page .header h1 {
        font-size: 26px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
}
