/**
 * ACH Authorization Form - Frontend Styles
 * 
 * These styles control the appearance of the form on the public-facing website.
 * The design aims to be professional and trustworthy, appropriate for financial forms.
 */

/* ===== Form Wrapper ===== */
.ach-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ===== Header Section ===== */
.ach-form-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 3px solid #2c3e50;
}

.ach-company-info h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: 2px;
}

.ach-company-subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.ach-company-contact {
    text-align: right;
    font-size: 13px;
    color: #555;
}

.ach-company-contact p {
    margin: 2px 0;
}

/* ===== Form Title ===== */
.ach-form-title {
    text-align: center;
    font-size: 22px;
    color: #2c3e50;
    margin: 20px 0 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* ===== Fieldsets ===== */
.ach-fieldset {
    margin: 0 0 25px 0;
    padding: 20px 25px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
}

.ach-fieldset legend {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    padding: 0 10px;
    background: #fafafa;
}

.ach-fieldset.ach-sensitive {
    border-color: #3498db;
    background: #f8fbff;
}

.ach-fieldset.ach-sensitive legend {
    color: #2980b9;
    background: #f8fbff;
}

.ach-fieldset.ach-authorization {
    border-color: #27ae60;
    background: #f8fff9;
}

.ach-fieldset.ach-authorization legend {
    color: #27ae60;
    background: #f8fff9;
}

/* ===== Form Groups ===== */
.ach-form-group {
    margin-bottom: 18px;
}

.ach-form-group:last-child {
    margin-bottom: 0;
}

.ach-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

.ach-form-group .required {
    color: #e74c3c;
    font-weight: bold;
}

/* ===== Form Rows (Multi-column layouts) ===== */
.ach-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 18px;
}

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

.ach-form-row .ach-form-group {
    margin-bottom: 0;
}

.ach-half {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
}

.ach-third {
    flex: 1 1 calc(33.333% - 10px);
    min-width: 150px;
}

.ach-quarter {
    flex: 1 1 calc(25% - 12px);
    min-width: 120px;
}

/* ===== Input Fields ===== */
.ach-form-wrapper input[type="text"],
.ach-form-wrapper input[type="tel"],
.ach-form-wrapper input[type="email"],
.ach-form-wrapper input[type="date"],
.ach-form-wrapper select {
    width: 100%;
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.ach-form-wrapper input[type="text"]:focus,
.ach-form-wrapper input[type="tel"]:focus,
.ach-form-wrapper input[type="email"]:focus,
.ach-form-wrapper input[type="date"]:focus,
.ach-form-wrapper select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.ach-form-wrapper input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

/* ===== Field Notes ===== */
.ach-field-note {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #777;
    font-style: italic;
}

/* ===== Help Text ===== */
.ach-help-text {
    margin: 0 0 15px 0;
    padding: 10px 15px;
    background: #fff8e6;
    border-left: 4px solid #f1c40f;
    font-size: 14px;
    color: #666;
}

/* ===== Radio Buttons ===== */
.ach-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.ach-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s;
}

.ach-radio-label:hover {
    border-color: #3498db;
    background: #f8fbff;
}

.ach-radio-label input[type="radio"] {
    margin-right: 8px;
    width: auto;
}

.ach-radio-label input[type="radio"]:checked + span {
    color: #2980b9;
    font-weight: 500;
}

.ach-radio-label:has(input[type="radio"]:checked) {
    border-color: #3498db;
    background: #e8f4fc;
}

/* ===== Checkbox ===== */
.ach-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
}

.ach-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: auto;
}

/* ===== Signature Field ===== */
.ach-signature-field {
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 20px !important;
    color: #1a3a5c;
}

/* ===== Terms & Conditions ===== */
.ach-terms {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.7;
}

.ach-terms h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.ach-terms p {
    margin: 0 0 12px 0;
}

.ach-terms p:last-child {
    margin-bottom: 0;
}

/* ===== Agreement Box ===== */
.ach-agreement-box {
    padding: 15px 20px;
    margin-bottom: 20px;
    background: #fff;
    border: 2px solid #27ae60;
    border-radius: 4px;
}

.ach-agreement-box p {
    margin: 0;
    font-size: 14px;
}

/* ===== Submit Button ===== */
.ach-form-submit {
    text-align: center;
    margin-top: 30px;
}

.ach-submit-button {
    display: inline-block;
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.ach-submit-button:hover {
    background: linear-gradient(135deg, #219a52, #27ae60);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.ach-submit-button:active {
    transform: translateY(0);
}

.ach-submit-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Loading Spinner ===== */
.ach-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ach-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ===== Security Notice ===== */
.ach-security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    padding: 15px;
    background: #f0f8f0;
    border-radius: 4px;
    text-align: center;
}

.ach-security-notice p {
    margin: 0;
    font-size: 13px;
    color: #555;
}

.ach-lock-icon {
    font-size: 20px;
}

/* ===== Messages ===== */
.ach-messages {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 4px;
    font-weight: 500;
}

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

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

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .ach-form-wrapper {
        padding: 20px 15px;
    }

    .ach-form-header {
        flex-direction: column;
        text-align: center;
    }

    .ach-company-contact {
        text-align: center;
        margin-top: 15px;
    }

    .ach-company-info h1 {
        font-size: 26px;
    }

    .ach-half,
    .ach-third,
    .ach-quarter {
        flex: 1 1 100%;
    }

    .ach-radio-group {
        flex-direction: column;
    }

    .ach-radio-label {
        width: 100%;
    }

    .ach-fieldset {
        padding: 15px;
    }

    .ach-submit-button {
        width: 100%;
        padding: 15px 30px;
    }
}

@media (max-width: 480px) {
    .ach-form-wrapper {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .ach-company-info h1 {
        font-size: 22px;
    }

    .ach-form-title {
        font-size: 18px;
    }

    .ach-terms {
        max-height: 200px;
    }
}

/* ===== Payment Type Selection ===== */
.ach-payment-type-section {
    margin-bottom: 20px;
}

.ach-payment-type-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 0;
}

.ach-payment-type-option {
    flex: 1 1 200px;
    max-width: 280px;
    position: relative;
}

.ach-payment-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ach-payment-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 140px;
    box-sizing: border-box;
}

.ach-payment-type-card:hover {
    border-color: #2c3e50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ach-payment-type-option input[type="radio"]:checked + .ach-payment-type-card {
    border-color: #27ae60;
    background: #f0fff4;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.2);
}

.ach-payment-type-option input[type="radio"]:checked + .ach-payment-type-card::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.ach-payment-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
}

.ach-payment-type-card strong {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 8px;
    display: block;
}

.ach-payment-type-card p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.ach-continue-btn {
    display: inline-block;
    padding: 14px 50px;
    background: #2c3e50;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ach-continue-btn:hover:not(:disabled) {
    background: #1a252f;
}

.ach-continue-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.ach-form-subtitle {
    text-align: center;
    color: #2c3e50;
    font-size: 20px;
    margin: 0 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #2c3e50;
}

@media (max-width: 500px) {
    .ach-payment-type-options {
        flex-direction: column;
        align-items: center;
    }
    
    .ach-payment-type-option {
        max-width: 100%;
        width: 100%;
    }
    
    .ach-continue-btn {
        width: 100%;
        padding: 14px 20px;
    }
}

/* ===== Fee Notice Boxes ===== */
.ach-fee-notice {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.ach-fee-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.ach-fee-notice-success {
    background: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.ach-fee-notice strong {
    font-weight: 700;
}

/* Prominent Fee Notice Box for Initial Screen */
.ach-fee-notice-box {
    margin-bottom: 25px;
}

.ach-fee-notice-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ach-fee-notice-item:last-child {
    margin-bottom: 0;
}

.ach-fee-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.ach-fee-notice-warning-prominent {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border: 2px solid #ffc107;
    color: #664d03;
}

.ach-fee-notice-warning-prominent .ach-fee-icon {
    color: #dc3545;
}

.ach-fee-notice-success-prominent {
    background: linear-gradient(135deg, #d1e7dd 0%, #a3cfbb 100%);
    border: 2px solid #198754;
    color: #0a3622;
}

.ach-fee-notice-success-prominent .ach-fee-icon {
    color: #198754;
    font-weight: bold;
}

.ach-fee-notice-item strong {
    font-weight: 700;
}

.ach-fee-notice-item div strong {
    color: inherit;
}

@media (max-width: 500px) {
    .ach-fee-notice-item {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .ach-fee-icon {
        font-size: 28px;
    }
}

/* ===== Contact Information Section ===== */
.ach-contact-info {
    margin-top: 30px;
    padding: 20px 25px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.6;
}

.ach-contact-info h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 10px;
}

.ach-contact-info p {
    margin: 8px 0;
}

.ach-contact-info a {
    color: #2c3e50;
    text-decoration: underline;
}

.ach-contact-info a:hover {
    color: #1a252f;
}

/* ===== Intro Paragraph ===== */
.ach-intro-paragraph {
    background: #f8f9fa;
    border-left: 4px solid #2c3e50;
    padding: 15px 20px;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.ach-intro-paragraph p {
    margin: 0;
}
