/* Combined Tyres Credit Application - Global Styles */

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

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

/* Header Banner */
.header-banner {
    background: white;
    border-bottom: 3px solid #1c5872;
    margin-bottom: 20px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-section {
    display: flex;
    align-items: center;
}

.company-logo {
    height: 80px;
    width: auto;
}

.company-details {
    text-align: right;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.service-area {
    background: linear-gradient(90deg, #1c5872 0%, #549a9f 50%, #98bda6 100%);
    color: white;
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 1px;
}

/* Form Container */
.form-container {
    max-width: 960px;
    margin: 0 auto 40px;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* Form Title */
.form-title {
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    color: #1c5872;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 14px;
}

/* Section Styling */
.section {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    background: #fafafa;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #1c5872;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #549a9f;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 8px solid #549a9f;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* Form Rows and Groups */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row.single {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
}

.required {
    color: #d32f2f;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Open Sans', sans-serif;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #549a9f;
}

.form-group input.error,
.form-group textarea.error {
    border-color: #d32f2f;
}

.form-group .error-message {
    color: #d32f2f;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-group input.error + .error-message,
.form-group textarea.error + .error-message {
    display: block;
}

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

/* Trade References Grid */
.trade-refs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.ref-card {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    background: white;
}

.ref-title {
    font-weight: 600;
    color: #1c5872;
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
}

/* Terms Section */
.terms-section {
    background: #f0f8ff;
    border: 2px solid #549a9f;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.terms-text {
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 15px;
    color: #333;
}

.highlight-terms {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    font-weight: 600;
    color: #856404;
    font-size: 13px;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 15px 0;
    padding: 12px;
    background: white;
    border-radius: 4px;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    transform: scale(1.3);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    flex: 1;
}

/* Signature Section */
.signature-block {
    border: 2px solid #1c5872;
    padding: 25px;
    border-radius: 8px;
    background: white;
    margin-top: 20px;
}

.signature-title {
    font-weight: 600;
    color: #1c5872;
    margin-bottom: 15px;
    text-align: center;
    font-size: 16px;
}

.signature-info {
    background: #f0f8ff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #555;
    text-align: center;
    font-style: italic;
}

/* Buttons */
.btn-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.btn {
    padding: 14px 32px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Open Sans', sans-serif;
}

.btn-primary {
    background: linear-gradient(135deg, #1c5872 0%, #549a9f 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #154458 0%, #3d7d82 100%);
    box-shadow: 0 4px 12px rgba(28, 88, 114, 0.3);
}

.btn-secondary {
    background: white;
    color: #1c5872;
    border: 2px solid #1c5872;
}

.btn-secondary:hover {
    background: #f5f5f5;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading State */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e0e0;
    border-top-color: #549a9f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 20px;
    color: #1c5872;
    font-size: 16px;
    font-weight: 600;
}

/* Success/Error Messages */
.message-box {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

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

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

/* What's Next Section - Post-Submission CTAs */
.whats-next-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #c3e6cb;
}

.whats-next-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1c5872;
    margin-bottom: 10px;
    text-align: center;
}

.whats-next-section > p {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    font-size: 14px;
}

/* CTA Buttons Container */
.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* Base CTA Button Styles */
.btn-cta {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Open Sans', sans-serif;
    border: 2px solid transparent;
}

/* Primary CTA - Gradient Button */
.btn-cta.btn-primary {
    background: linear-gradient(135deg, #1c5872 0%, #549a9f 100%);
    color: white;
    border-color: transparent;
}

.btn-cta.btn-primary:hover {
    background: linear-gradient(135deg, #154458 0%, #3d7d82 100%);
    box-shadow: 0 4px 12px rgba(28, 88, 114, 0.3);
    transform: translateY(-2px);
}

/* Secondary CTAs - Outline Buttons */
.btn-cta.btn-secondary {
    background: white;
    color: #1c5872;
    border-color: #1c5872;
}

.btn-cta.btn-secondary:hover {
    background: #f0f8ff;
    border-color: #549a9f;
    color: #549a9f;
    transform: translateY(-2px);
}

/* Return Link (Tertiary CTA) */
.return-link {
    text-align: center;
    margin-top: 15px;
}

.return-link a {
    color: #549a9f;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.return-link a:hover {
    color: #1c5872;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .company-details {
        text-align: center;
    }

    .service-area {
        font-size: 9px;
        padding: 10px 15px;
    }

    .form-container {
        padding: 20px;
    }

    .form-row,
    .trade-refs {
        grid-template-columns: 1fr;
    }

    .form-title {
        font-size: 22px;
    }

    .btn-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    /* CTA Buttons Mobile Layout */
    .cta-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .btn-cta {
        width: 100%;
        padding: 14px 20px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .header-banner {
        border-bottom: 2px solid #1c5872;
    }

    .form-container {
        box-shadow: none;
        padding: 0;
    }

    .btn-container,
    .loading-overlay {
        display: none;
    }

    .section {
        page-break-inside: avoid;
    }
}
