/**
 * Church Manager — Frontend Account & Registration Styles
 */

/* ─── Registration Form ─── */

.cm-register-form {
    max-width: 700px;
    margin: 0 auto;
}

.cm-reg-section {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fafafa;
}

.cm-reg-section legend {
    font-weight: 600;
    font-size: 1.1em;
    padding: 0 8px;
}

.cm-form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.cm-form-field {
    margin-bottom: 14px;
}

.cm-form-field.cm-half {
    flex: 1 1 45%;
    min-width: 200px;
}

.cm-form-field label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.9em;
    color: #333;
}

.cm-form-field input[type="text"],
.cm-form-field input[type="email"],
.cm-form-field input[type="tel"],
.cm-form-field input[type="date"],
.cm-form-field input[type="number"],
.cm-form-field select,
.cm-form-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
    box-sizing: border-box;
}

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

.cm-form-field input[type="checkbox"] {
    margin-right: 6px;
}

.cm-toggle-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

/* Children repeater */
.cm-child-entry {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
}

.cm-child-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.cm-remove-child {
    color: #b32d2e;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.85em;
    text-decoration: underline;
}

.cm-remove-child:hover {
    color: #8b0000;
}

.cm-reg-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 0.95em;
}

/* ─── My Account ─── */

.cm-my-account {
    max-width: 900px;
    margin: 0 auto;
}

.cm-account-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.cm-account-tab-link {
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.cm-account-tab-link:hover {
    color: #111;
}

.cm-account-tab-link.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

.cm-account-panel {
    animation: cmFadeIn 0.2s ease;
}

@keyframes cmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Profile table */
.cm-profile-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.cm-profile-table th {
    text-align: left;
    padding: 8px 12px 8px 0;
    font-weight: 500;
    color: #666;
    width: 160px;
    vertical-align: top;
    border-bottom: 1px solid #f0f0f0;
}

.cm-profile-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* Profile edit form within account */
#cm-profile-edit .cm-form-field {
    max-width: 400px;
}

.cm-profile-msg {
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
}

/* Family cards */
.cm-family-members {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.cm-family-card {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 14px 18px;
    min-width: 180px;
    flex: 0 1 250px;
}

.cm-child-card {
    border-left: 3px solid #2271b1;
}

/* Shared styles for success/error messages */
.cm-signup-success,
.cm-profile-msg.cm-signup-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cm-signup-error,
.cm-profile-msg.cm-signup-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Common button style */
.cm-signup-button {
    display: inline-block;
    padding: 10px 24px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.cm-signup-button:hover {
    background: #135e96;
    color: #fff;
}

.cm-signup-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button {
    display: inline-block;
    padding: 8px 16px;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 0.9em;
}

.button:hover {
    background: #e0e0e0;
}

/* Responsive */
@media (max-width: 600px) {
    .cm-form-field.cm-half {
        flex: 1 1 100%;
    }

    .cm-account-tabs {
        flex-direction: column;
    }

    .cm-account-tab-link {
        border-bottom: none;
        border-left: 2px solid transparent;
        margin-bottom: 0;
        margin-left: -2px;
    }

    .cm-account-tab-link.active {
        border-left-color: #2271b1;
        border-bottom-color: transparent;
    }

    .cm-profile-table th {
        width: auto;
        display: block;
        padding-bottom: 2px;
        border: none;
    }

    .cm-profile-table td {
        display: block;
        padding-top: 0;
    }

    .cm-family-card {
        flex: 1 1 100%;
    }
}
