/* CJ Portal Forms - Customer Facing Styles */

.cjforms-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.cjforms-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.cjforms-logo {
    max-width: 180px !important;
    max-height: 110px !important;
    width: auto !important;
    height: auto !important;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.cjforms-header h1 {
    margin: 10px 0;
    color: #333;
    font-size: 28px;
}

.cjforms-back-btn {
    display: inline-block;
    margin-top: 10px;
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
}

.cjforms-back-btn:hover {
    text-decoration: underline;
}

.cjforms-intro {
    background: #f0f6fc;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    border-left: 4px solid #2271b1;
}

.cjforms-intro p {
    margin: 0;
    color: #1d2327;
}

.cjforms-version-notice {
    background: #fff3cd;
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    border-left: 4px solid #f0b429;
}

.cjforms-version-notice p {
    margin: 0;
    color: #664d03;
}

.cjforms-section {
    background: #fff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cjforms-section h2 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    color: #1d2327;
    font-size: 20px;
}

.cjforms-section-instructions {
    background: #f0f6ff;
    border-left: 4px solid #2271b1;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #2c3338;
    white-space: pre-wrap;
}

.cjforms-field {
    margin-bottom: 20px;
}

.cjforms-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.cjforms-field .required {
    color: #d63638;
}

.cjforms-field input[type="text"],
.cjforms-field input[type="email"],
.cjforms-field input[type="tel"],
.cjforms-field input[type="number"],
.cjforms-field input[type="date"],
.cjforms-field input[type="time"],
.cjforms-field textarea,
.cjforms-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

.cjforms-field input:focus,
.cjforms-field textarea:focus,
.cjforms-field select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.cjforms-field input[readonly] {
    background: #f6f7f7;
    color: #666;
    cursor: not-allowed;
}

.cjforms-field textarea {
    resize: vertical;
    min-height: 100px;
}

.cjforms-checkbox-label,
.cjforms-radio-label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
    cursor: pointer;
}

.cjforms-checkbox-label input,
.cjforms-radio-label input {
    margin-right: 8px;
}

.cjforms-notice {
    background: #fff3cd;
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    border-left: 4px solid #f0b429;
}

.cjforms-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding: 25px 0;
}

.cjforms-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.cjforms-btn-primary {
    background: #2271b1;
    color: #fff;
}

.cjforms-btn-primary:hover {
    background: #135e96;
}

.cjforms-btn-secondary {
    background: #f0f0f1;
    color: #2c3338;
    border: 1px solid #c3c4c7;
}

.cjforms-btn-secondary:hover {
    background: #e0e0e1;
}

.cjforms-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: center;
    font-weight: 600;
}

.cjforms-message-success {
    background: #d1e7dd;
    color: #0a3622;
    border-left: 4px solid #0f5132;
}

.cjforms-message-error {
    background: #f8d7da;
    color: #58151c;
    border-left: 4px solid #842029;
}

.cjforms-error {
    background: #f8d7da;
    color: #58151c;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
    border-left: 4px solid #842029;
}

/* Side-by-side field layouts */
.cjforms-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 0;
}

.cjforms-field-row.three-columns {
    grid-template-columns: 1fr 1fr 1fr;
}

.cjforms-field-row.four-columns {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

.cjforms-field-row.five-columns {
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
}

.cjforms-field-row .cjforms-field {
    margin-bottom: 0;
}

/* Reduce label spacing in multi-column rows */
.cjforms-field-row .cjforms-field label {
    margin-bottom: 4px;
}

/* Tighter padding for inputs in multi-column layouts */
.cjforms-field-row .cjforms-field input[type="text"],
.cjforms-field-row .cjforms-field input[type="email"],
.cjforms-field-row .cjforms-field input[type="tel"],
.cjforms-field-row .cjforms-field input[type="number"],
.cjforms-field-row .cjforms-field select {
    padding: 8px 10px;
}

/* Label-only fields in table rows */
.cjforms-field-row .cjforms-label-field {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cjforms-label-field .cjforms-label-text {
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
    text-align: center;
}

/* Highlight middle columns (name fields) in 4-column layouts */
.cjforms-field-row.four-columns .cjforms-field:nth-child(2) input[type="text"],
.cjforms-field-row.four-columns .cjforms-field:nth-child(3) input[type="text"] {
    background-color: #fff9e6;
    font-weight: 600;
    border: 1px solid #f0b429;
}

.cjforms-field-row.four-columns .cjforms-field:nth-child(2) input[type="text"]:focus,
.cjforms-field-row.four-columns .cjforms-field:nth-child(3) input[type="text"]:focus {
    background-color: #fff9e6;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

@media (max-width: 768px) {
    .cjforms-container {
        margin: 20px auto;
        padding: 15px;
    }
    
    .cjforms-section {
        padding: 20px 15px;
    }
    
    .cjforms-actions {
        flex-direction: column;
    }
    
    .cjforms-btn {
        width: 100%;
    }
    
    /* Stack fields vertically on mobile */
    .cjforms-field-row,
    .cjforms-field-row.three-columns,
    .cjforms-field-row.four-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .cjforms-field-row .cjforms-field {
        margin-bottom: 20px;
    }
}
