/* Baiona Socis — Public Form Styles */

.baiona-socis-form-wrapper {
    max-width: 720px;
    margin: 0 auto;
}

.baiona-public-form fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: #fafafa;
}

.baiona-public-form legend {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0 0.5rem;
    color: #2c5f2d;
}

.baiona-field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.baiona-field {
    flex: 1;
    min-width: 200px;
    margin-bottom: 1rem;
}

.baiona-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
}

.baiona-field input[type="text"],
.baiona-field input[type="email"],
.baiona-field input[type="tel"],
.baiona-field input[type="date"],
.baiona-field select,
.baiona-field textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.baiona-field select {
    height: 2.5rem;
}

.baiona-field input:focus,
.baiona-field select:focus {
    border-color: #2c5f2d;
    outline: none;
    box-shadow: 0 0 0 2px rgba(44, 95, 45, 0.15);
}

.baiona-field-note {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: #e8f5e9;
    border-radius: 4px;
    background: #c8e6c9;
}

/* Buttons */
.baiona-btn-primary {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: #2c5f2d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: center;
}

.baiona-btn-primary:hover {
    background: #1e4620;
}

.baiona-btn-primary:disabled {
    background: #999;
    cursor: not-allowed;
}

.baiona-btn-secondary {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #fff;
    color: #2c5f2d;
    border: 2px solid #2c5f2d;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.baiona-btn-secondary:hover {
    background: #2c5f2d;
    color: #fff;
}

/* GDPR */
.baiona-gdpr-field {
    border: none;
    padding: 0;
}

.baiona-gdpr-field label {
    display: inline;
    font-weight: 400;
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
}

.baiona-gdpr-field input[type="checkbox"] {
    vertical-align: middle;
    margin-right: 0.4rem;
}

/* Success */
.baiona-success-msg {
    text-align: center;
    padding: 2rem;
    background: #e8f5e9;
    border: 2px solid #2c5f2d;
    border-radius: 8px;
}

.baiona-success-msg h3 {
    color: #2c5f2d;
    margin-top: 0;
}

/* Errors */
.baiona-form-errors {
    background: #fef2f2;
    border: 1px solid #dc2626;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #991b1b;
}

.baiona-form-errors ul {
    margin: 0;
    padding-left: 1.2rem;
}

/* Household member card */
.baiona-household-member {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.baiona-household-member .baiona-remove-member {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #dc2626;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* Loading */
#baiona-form-loading {
    text-align: center;
    padding: 0.5rem;
    color: #666;
    font-style: italic;
}

@media (max-width: 600px) {
    .baiona-field-row {
        flex-direction: column;
        gap: 0;
    }

    .baiona-field {
        min-width: 100%;
    }
}

/* ===== Portal (Magic Link Self-Service) ===== */

.baiona-portal {
    max-width: 600px;
    margin: 0 auto;
}

.baiona-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: #2c5f2d;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 0.5rem;
}

.baiona-btn:hover {
    background: #1e4620;
}

.baiona-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.baiona-btn-secondary {
    background: #fff;
    color: #2c5f2d;
    border: 2px solid #2c5f2d;
}

.baiona-btn-secondary:hover {
    background: #2c5f2d;
    color: #fff;
}

.baiona-portal-card {
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.baiona-portal-card h4 {
    margin-top: 0;
    color: #2c5f2d;
}

.baiona-portal-card small {
    font-weight: 400;
    color: #888;
}

.baiona-message {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.baiona-message--success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.baiona-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.baiona-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.baiona-badge--pagat {
    background: #dcfce7;
    color: #166534;
}

.baiona-badge--pendent {
    background: #fef9c3;
    color: #854d0e;
}

.baiona-badge--impagat {
    background: #fef2f2;
    color: #991b1b;
}

.baiona-portal-card ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

/* Household member cards */
.baiona-household-member {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
    position: relative;
}

.baiona-household-member .baiona-remove-member {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: #991b1b;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 6px;
}

.baiona-household-member .baiona-remove-member:hover {
    background: #fef2f2;
    border-radius: 4px;
}

/* Payment history table */
.baiona-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.baiona-history-table th,
.baiona-history-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.baiona-history-table th {
    background: #f3f4f6;
    font-weight: 600;
    font-size: 0.85rem;
    color: #374151;
}

.baiona-history-table tr:last-child td {
    border-bottom: none;
}
