/**
 * BuenReg Frontend Styles
 *
 * @package BuenReg
 * @since 2.0.0
 */

/* Form Container */
.buenreg-form-container {
    max-width: 600px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.buenreg-form-title {
    margin: 0 0 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

/* Messages */
.buenreg-message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.buenreg-message-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.buenreg-message-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

/* Sections */
.buenreg-section {
    margin-bottom: 30px;
}

.buenreg-section-title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #555;
}

/* Fields */
.buenreg-field {
    margin-bottom: 15px;
}

.buenreg-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
}

.buenreg-field .required {
    color: #dc2626;
}

.buenreg-field input,
.buenreg-field select,
.buenreg-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.buenreg-field input:focus,
.buenreg-field select:focus,
.buenreg-field textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.buenreg-field input.error {
    border-color: #dc2626;
}

/* Member Rows */
.buenreg-member-row {
    padding: 20px;
    margin-bottom: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.buenreg-member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.buenreg-member-number {
    font-weight: 600;
    color: #374151;
}

.buenreg-required-badge {
    padding: 2px 8px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    text-transform: uppercase;
}

.buenreg-member-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.buenreg-field-name {
    grid-column: span 2;
}

@media (max-width: 480px) {
    .buenreg-member-fields {
        grid-template-columns: 1fr;
    }
    
    .buenreg-field-name {
        grid-column: span 1;
    }
}

/* Help Text */
.buenreg-help-text {
    margin: 10px 0 0;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* Product Info */
.buenreg-product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin: 20px 0;
    background: #f3f4f6;
    border-radius: 6px;
}

.buenreg-product-name {
    font-weight: 600;
    color: #374151;
}

.buenreg-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
}

/* Submit Button */
.buenreg-submit {
    margin-top: 25px;
}

.buenreg-submit-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.buenreg-submit-btn:hover {
    background: #005a87;
}

.buenreg-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.buenreg-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Spinner */
.buenreg-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: buenreg-spin 0.8s linear infinite;
}

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

/* Status Badges */
.buenreg-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.buenreg-status-active {
    background: #d1fae5;
    color: #065f46;
}

.buenreg-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.buenreg-status-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.buenreg-status-inactive {
    background: #e5e7eb;
    color: #4b5563;
}

/* Tables */
.buenreg-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.buenreg-table th,
.buenreg-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.buenreg-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.buenreg-table tr:hover {
    background: #f9fafb;
}

/* Notice */
.buenreg-notice {
    padding: 15px 20px;
    background: #f3f4f6;
    border-left: 4px solid #6b7280;
    color: #4b5563;
}

/* Existing Members (Reusable Mode) */
.buenreg-existing-members {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.buenreg-existing-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.buenreg-existing-member-item:hover {
    border-color: #007cba;
    background: #f0f9ff;
}

.buenreg-existing-member-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.buenreg-existing-member-item input[type="checkbox"]:checked + .buenreg-member-info {
    font-weight: 500;
}

.buenreg-member-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.buenreg-member-age {
    color: #6b7280;
    font-size: 14px;
}

/* Notes Field */
.buenreg-field-notes textarea {
    width: 100%;
    min-height: 60px;
    resize: vertical;
}

.buenreg-field-full {
    grid-column: 1 / -1;
}
