/* Frontend styling for Coupon Pro in Fluent Forms */

.pfa-coupon-field-wrapper {
    margin: 12px 0;
    max-width: 440px;
    font-family: inherit;
}

.pfa-coupon-input-group {
    display: flex;
    align-items: stretch;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.pfa-coupon-code-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-right: none;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    padding: 10px 14px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #111827;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pfa-coupon-code-input:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
    z-index: 2;
}

.pfa-apply-coupon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background-color: #2563eb;
    border: 1px solid #2563eb;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    white-space: nowrap;
    z-index: 1;
}

.pfa-apply-coupon-btn:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
}

.pfa-apply-coupon-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.pfa-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: pfa-spin 0.8s linear infinite;
    margin-left: 6px;
}

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

/* Feedback Messages */
.pfa-coupon-message {
    margin-top: 8px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 5px;
    line-height: 1.4;
    transition: all 0.2s;
}

.pfa-msg-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.pfa-msg-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Applied Coupon Tag */
.pfa-applied-coupon-details {
    margin-top: 8px;
}

.pfa-applied-tag {
    display: inline-flex;
    align-items: center;
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    gap: 8px;
}

.pfa-icon-check {
    font-size: 16px;
    color: #16a34a;
    display: inline-block;
}

.pfa-applied-code {
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pfa-applied-discount {
    background: #dcfce7;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.pfa-remove-coupon-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 4px;
    display: inline-flex;
    align-items: center;
    font-weight: bold;
    transition: color 0.15s;
}

.pfa-remove-coupon-btn:hover {
    color: #b91c1c;
}

/* Styling for Discount Line inside Fluent Forms native Payment Summary Table */
.pfa-summary-subtotal-row th {
    color: #475569 !important;
    font-weight: 600 !important;
}

.pfa-summary-discount-row th {
    color: #16a34a !important;
    font-weight: 700 !important;
}

.pfa-summary-total-row th {
    font-weight: 800 !important;
    color: #0f172a !important;
    font-size: 1.05em !important;
}

.pfa-summary-subtotal-row th:last-child,
.pfa-summary-discount-row th:last-child,
.pfa-summary-total-row th:last-child {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.pfa-summary-discount-amount {
    white-space: nowrap !important;
    display: inline-block !important;
    word-break: normal !important;
}

/* Fluent Forms Conditional Logic styling for Coupon Group */
.ff-el-group.has-conditions:not(.ff_cond_v) {
    display: none;
}
.ff-el-group.has-conditions.ff_cond_v {
    display: block;
}
.ff-el-group.has-conditions.ff_excluded {
    display: none !important;
}

