/* Snug Network Forms — mobile-first, minimal */
/* Global theme overrides are in snug-global.css (loaded on every page). */

.snug-form {
    max-width: 640px;
    margin: 0 auto;
    padding: 24px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Sections */
.snug-form-section {
    margin-bottom: 24px;
}

.snug-form-section h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
}

/* Fields */
.snug-form-field {
    margin-bottom: 16px;
}

.snug-form-field label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #1e1e1e;
}

.snug-form-required {
    color: #d63638;
    margin-left: 2px;
}

.snug-form-field input[type="text"],
.snug-form-field input[type="email"],
.snug-form-field input[type="url"],
.snug-form-field input[type="tel"],
.snug-form-field input[type="number"],
.snug-form-field input[type="date"],
.snug-form-field input[type="password"],
.snug-form-field textarea,
.snug-form-field select {
    display: block;
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #1e1e1e;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.snug-form-field input:focus,
.snug-form-field textarea:focus,
.snug-form-field select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.snug-form-field textarea {
    min-height: 100px;
    resize: vertical;
}

/* Multiselect option text visibility */
.snug-form-field select option {
    color: #1e1e1e;
    background: #fff;
    padding: 4px 8px;
}

.snug-form-field select option:checked {
    background: #0073aa linear-gradient(0deg, #0073aa 0%, #0073aa 100%);
    color: #fff;
}

/* Help text */
.snug-form-help {
    margin-top: 4px;
    font-size: 12px;
    color: #757575;
}

/* Validation errors */
.snug-field-error input,
.snug-field-error textarea,
.snug-field-error select {
    border-color: #d63638;
}

.snug-form-error {
    margin-top: 4px;
    font-size: 12px;
    color: #d63638;
}

/* Error banner — explicit color overrides the inherit rule */
.snug-form-error-banner,
.snug-form-error-banner * {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fcf0f0;
    border: 1px solid #d63638;
    border-radius: 4px;
    color: #d63638 !important;
    font-size: 14px;
}

/* Success banner */
.snug-form-success,
.snug-form-success * {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #edfaef;
    border: 1px solid #00a32a;
    border-radius: 4px;
    color: #00a32a !important;
    font-size: 14px;
}

/* Checkbox */
.snug-form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
}

.snug-form-checkbox input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.snug-form-checkbox label {
    font-size: 14px;
    font-weight: 400;
    color: #1e1e1e;
}

/* Star rating */
.snug-form-rating {
    display: inline-flex;
    gap: 4px;
    margin-top: 4px;
}

.snug-star {
    font-size: 24px;
    color: #ccc;
    cursor: pointer;
    user-select: none;
    transition: color 0.1s ease;
}

.snug-star.active {
    color: #f0b429;
}

.snug-star:hover {
    color: #f0b429;
}

/* Actions */
.snug-form-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.snug-form-submit {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #0073aa;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.snug-form-submit:hover {
    background: #005d8c;
}

.snug-form-submit:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

/* Existing photos grid (edit profile) */
.snug-profile-photos-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.snug-profile-photo-item {
    position: relative;
    display: inline-block;
}

.snug-profile-photo-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.snug-profile-photo-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(214, 54, 56, 0.85);
    color: #fff !important;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.snug-profile-photo-remove input[type="checkbox"] {
    display: none;
}

.snug-profile-photo-remove:has(input:checked) {
    background: #d63638;
}

.snug-profile-photo-item:has(input:checked) .snug-profile-photo-thumb {
    opacity: 0.3;
    border-color: #d63638;
}

/* Read-only info cards */
.snug-form-readonly {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #f6f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #50575e;
}

/* Agreement link in checkbox */
.snug-agreement-link {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.snug-agreement-link:hover {
    color: #005d8c;
}

/* Agreement modal */
.snug-agreement-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.snug-agreement-modal {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    width: 100%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.snug-agreement-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.snug-agreement-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e1e1e;
}

.snug-agreement-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #757575;
    cursor: pointer;
    padding: 0 4px;
}

.snug-agreement-modal-close:hover {
    color: #1e1e1e;
}

.snug-agreement-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    background: #fff;
}

.snug-agreement-modal-body * {
    color: inherit;
}

.snug-agreement-modal-body h1,
.snug-agreement-modal-body h2,
.snug-agreement-modal-body h3,
.snug-agreement-modal-body h4,
.snug-agreement-modal-body h5,
.snug-agreement-modal-body h6 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #1e1e1e;
}

.snug-agreement-modal-body p {
    margin-bottom: 0.75em;
}

.snug-agreement-modal-body ul,
.snug-agreement-modal-body ol {
    margin-bottom: 0.75em;
    padding-left: 1.5em;
}

.snug-agreement-loading {
    text-align: center;
    padding: 40px 20px;
    color: #757575;
}

@media (max-width: 600px) {
    .snug-agreement-overlay {
        padding: 0;
        align-items: flex-end;
    }
    .snug-agreement-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }
}

/* File upload preview */
.snug-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.snug-file-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
}
