/* Form Styles - Shared CSS for Account and Credit Application Pages */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Breadcrumb Styles - aligned with sidebar/menu layout */
.breadcrumb {
    background: white;
    padding: 15px 40px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
    max-width: 1400px;
    margin: 12px auto 0;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #a0522d;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

/* Container Styles */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    gap: 0;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    background: #e8e8e8;
    width: 240px;
    height: fit-content;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
}

.sidebar-header {
    background: #8b4513;
    color: white;
    padding: 20px;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    border-bottom: 1px solid #d0d0d0;
}

.sidebar-menu a {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 15px 20px;
    transition: all 0.3s;
    font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #d8d8d8;
    padding-left: 30px;
    color: #8b4513;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 12px 30px 25px;
    background: white;
}

/* Form Header Styles */
.form-header {
    text-align: center;
    margin-bottom: 12px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-header h1 {
    font-size: 20px;
    color: #2c3e50;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-header .company-info {
    color: #666;
    font-size: 11px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Section Title Styles - Only for forms */
.main-content .section-title,
form .section-title,
.form-section .section-title {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 8px 15px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.15);
}

/* Form Group Styles */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: #2c3e50;
    margin-bottom: 4px;
    font-weight: 600;
}

.required {
    color: #d9534f;
    font-size: 12px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.3s;
    background: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #a0522d;
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.1);
}

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

.help-text {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

.error-message {
    display: block;
    color: #e74c3c;
    font-size: 10px;
    margin-top: 2px;
}

/* Name Row Styles */
.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

/* Checkbox Group Styles */
.checkbox-group {
    margin: 8px 0;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-weight: normal;
    cursor: pointer;
    font-size: 11px;
    color: #555;
    line-height: 1.3;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    cursor: pointer;
    accent-color: #a0522d;
    flex-shrink: 0;
    /* Restore native control appearance so checked state is visible */
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
}

/* Button Group Styles */
.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1.5px solid #e0e0e0;
}

.btn {
    padding: 8px 28px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.btn-primary {
    background: linear-gradient(135deg, #a0522d 0%, #8b4513 100%) !important;
    color: white !important;
    position: relative;
}

.btn-primary::before {
    display: none !important;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #b8653a 0%, #9d5a1f 100%) !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(160, 82, 45, 0.4);
}

.btn-primary:hover::before {
    display: none !important;
}

/* Success Message Styles */
.success-message {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: none;
    animation: slideDown 0.5s ease;
}

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

.success-message h2 {
    font-size: 14px;
    margin-bottom: 4px;
}

/* Loading Styles */
.loading {
    text-align: center;
    padding: 12px;
    display: none;
}

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

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

/* ============================================
   RESPONSIVE STYLES - MOBILE FIRST APPROACH
   ============================================ */

/* Large Desktop (1400px+) - Already handled by default styles */

/* Desktop (1024px - 1399px) */
@media (max-width: 1399px) {
    .container {
        max-width: 100%;
    }
}

/* Tablet Landscape & Small Desktop (768px - 1023px) */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
        max-width: 100%;
    }

    .sidebar {
        width: 100%;
        position: relative;
        order: 1;
    }

    .main-content {
        padding: 15px 25px 30px;
        order: 2;
    }

    /* Improve form rows for tablet */
    .form-row.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait & Mobile Landscape (600px - 767px) */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
        padding: 0;
    }

    .breadcrumb {
        padding: 10px 15px;
        font-size: 12px;
    }

    .sidebar {
        width: 100%;
        position: relative;
        margin-bottom: 0;
    }

    .sidebar-header {
        padding: 12px;
        font-size: 14px;
    }

    .sidebar-menu a {
        padding: 14px 18px;
        font-size: 13px;
        text-align: center;
    }

    .main-content {
        padding: 15px 15px 25px;
        width: 100%;
    }

    .form-header {
        padding: 12px 15px;
        margin-bottom: 15px;
    }

    .form-header h1 {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .form-header .company-info {
        font-size: 11px;
        line-height: 1.4;
    }

            .main-content .section-title,
            form .section-title,
            .form-section .section-title {
                padding: 10px 15px;
                font-size: 14px;
                margin-bottom: 12px;
            }

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

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        border: 2px solid #e0e0e0;
    }

    .name-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 15px;
    }

    .name-row > div {
        margin-bottom: 15px;
    }

    .name-row > div:last-child {
        margin-bottom: 0;
    }

    .checkbox-group {
        margin: 15px 0;
    }

    .checkbox-group label {
        font-size: 12px;
        line-height: 1.5;
    }

    .checkbox-group input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .button-group {
        margin-top: 20px;
        padding-top: 20px;
    }

    .btn {
        padding: 14px 30px;
        font-size: 16px;
        width: 100%;
        max-width: 100%;
    }

    .help-text {
        font-size: 11px;
    }

    .error-message {
        font-size: 11px;
    }

    /* Ensure touch targets are at least 44x44px */
    .btn,
    .sidebar-menu a,
    .checkbox-group label,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Improve button spacing */
    .button-group {
        flex-direction: column;
        gap: 12px;
    }

    .btn {
        width: 100%;
    }
}

/* Mobile Portrait (480px - 599px) */
@media (max-width: 599px) {
    .breadcrumb {
        padding: 10px 12px;
        font-size: 11px;
        word-break: break-word;
    }

    .main-content {
        padding: 12px 12px 20px;
    }

    .form-header {
        padding: 10px 12px;
    }

    .form-header h1 {
        font-size: 18px;
        line-height: 1.3;
    }

    .form-header .company-info {
        font-size: 10px;
    }

    .main-content .section-title,
    form .section-title,
    .form-section .section-title {
        padding: 8px 12px;
        font-size: 13px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* Small Mobile Portrait (320px - 479px) */
@media (max-width: 480px) {
    .breadcrumb {
        padding: 8px 12px;
        font-size: 11px;
    }

    .main-content {
        padding: 12px 12px 20px;
    }

    .form-header {
        padding: 10px 12px;
    }

    .form-header h1 {
        font-size: 18px;
    }

    .form-header .company-info {
        font-size: 10px;
    }

            .main-content .section-title,
            form .section-title,
            .form-section .section-title {
                padding: 8px 12px;
                font-size: 13px;
            }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
    }

    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    /* Extra small adjustments */
    .breadcrumb {
        padding: 8px 10px;
        font-size: 10px;
    }

    .sidebar-header {
        padding: 10px;
        font-size: 13px;
    }

    .sidebar-menu a {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* Landscape Orientation Support */
@media (max-width: 1024px) and (orientation: landscape) {
    .sidebar {
        display: none; /* Hide sidebar in landscape to save space */
    }

    .main-content {
        padding: 15px 20px;
    }

    /* Allow 2 columns in landscape for forms */
    .form-row.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding: 12px 15px;
    }

    .form-header h1 {
        font-size: 20px;
    }

    /* Keep forms compact in landscape */
    .form-group {
        margin-bottom: 10px;
    }
}

/* Very Small Screens (below 360px) */
@media (max-width: 360px) {
    .breadcrumb {
        padding: 6px 8px;
        font-size: 9px;
    }

    .main-content {
        padding: 10px 8px 15px;
    }

    .form-header {
        padding: 8px 10px;
    }

    .form-header h1 {
        font-size: 16px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px;
        font-size: 16px;
    }

    .btn {
        padding: 12px 15px;
        font-size: 15px;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .breadcrumb,
    .button-group {
        display: none;
    }    .main-content {
        padding: 0;
        max-width: 100%;
    }

    .form-group {
        page-break-inside: avoid;
    }
}