/**
 * Stili Iscrizione Soci - ScubaDiabetes Logbook
 *
 * Usa le variabili CSS definite in dive-form.css
 */

/* ===== WRAP PRINCIPALE ===== */
.sd-membership-wrap,
.sd-management-wrap,
.sd-edit-wrap {
	max-width: 900px;
	margin: 0 auto;
	padding: 0 1rem;
}

/* ===== INTESTAZIONE ===== */
.sd-form-header {
	margin-bottom: 2rem;
	padding-bottom: 1rem;
	border-bottom: 2px solid var(--sd-border, #dde1e7);
}

.sd-form-title {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--sd-primary, #0055a5);
	margin: 0 0 0.25rem 0;
}

.sd-form-subtitle {
	color: var(--sd-muted, #6b7280);
	margin: 0;
}

/* ===== SEZIONI FORM ===== */
.sd-form-section {
	background: #fff;
	border: 1px solid var(--sd-border, #dde1e7);
	border-radius: 8px;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

.sd-section-title {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--sd-primary, #0055a5);
	margin: 0 0 1.25rem 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.sd-section-warning {
	color: #92400e;
}

.sd-subsection-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: #374151;
	margin: 1.25rem 0 0.75rem 0;
	padding-top: 0.75rem;
	border-top: 1px solid #f3f4f6;
}

/* ===== LAYOUT CAMPI ===== */
.sd-field-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.sd-field-group {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sd-field-full   { flex: 1 1 100%; }
.sd-field-half   { flex: 1 1 calc(50% - 0.5rem); }
.sd-field-third  { flex: 1 1 calc(33.333% - 0.667rem); }
.sd-field-quarter { flex: 1 1 calc(25% - 0.75rem); }
.sd-field-sixth  { flex: 1 1 calc(16.666% - 0.833rem); }

@media (max-width: 640px) {
	.sd-field-half,
	.sd-field-third,
	.sd-field-quarter,
	.sd-field-sixth {
		flex: 1 1 100%;
	}
}

/* ===== LABEL ===== */
.sd-label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #374151;
	margin-bottom: 0.35rem;
}

.sd-label-required::after {
	content: ' *';
	color: #dc2626;
}

.sd-field-note {
	font-size: 0.78rem;
	color: var(--sd-muted, #6b7280);
	margin-top: 0.2rem;
}

/* ===== CAMPI INPUT ===== */
.sd-input,
.sd-select,
.sd-textarea {
	width: 100%;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--sd-border, #dde1e7);
	border-radius: 6px;
	font-size: 0.9rem;
	color: #111827;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.sd-input:focus,
.sd-select:focus,
.sd-textarea:focus {
	outline: none;
	border-color: var(--sd-primary, #0055a5);
	box-shadow: 0 0 0 3px rgba(0, 85, 165, 0.12);
}

.sd-input-sm,
.sd-select-sm {
	padding: 0.35rem 0.6rem;
	font-size: 0.82rem;
}

.sd-textarea {
	resize: vertical;
	min-height: 80px;
}

/* ===== RADIO E CHECKBOX ===== */
.sd-radio-group {
	display: flex;
	gap: 1.25rem;
	padding: 0.5rem 0;
}

.sd-radio-label,
.sd-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	cursor: pointer;
	font-size: 0.9rem;
	color: #374151;
	line-height: 1.4;
}

.sd-radio-label input,
.sd-checkbox-label input {
	margin-top: 0.15rem;
	flex-shrink: 0;
}

.sd-checkbox-large {
	font-size: 0.95rem;
}

/* ===== CARDS TASSA ===== */
.sd-fee-cards {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}

.sd-fee-card {
	cursor: pointer;
	flex: 1 1 180px;
}

.sd-fee-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.sd-fee-card-inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 1.25rem 1rem;
	border: 2px solid var(--sd-border, #dde1e7);
	border-radius: 10px;
	text-align: center;
	transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.sd-fee-card:hover .sd-fee-card-inner {
	border-color: var(--sd-primary, #0055a5);
	box-shadow: 0 2px 8px rgba(0, 85, 165, 0.1);
}

.sd-fee-card input:checked + .sd-fee-card-inner {
	border-color: var(--sd-primary, #0055a5);
	background: rgba(0, 85, 165, 0.05);
	box-shadow: 0 2px 8px rgba(0, 85, 165, 0.15);
}

.sd-fee-price {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--sd-primary, #0055a5);
}

.sd-fee-label {
	font-weight: 600;
	font-size: 0.95rem;
	color: #374151;
	margin-top: 0.25rem;
}

.sd-fee-desc {
	font-size: 0.78rem;
	color: var(--sd-muted, #6b7280);
	margin-top: 0.25rem;
}

/* ===== CONSENT BLOCKS ===== */
.sd-consent-block {
	background: #f9fafb;
	border: 1px solid var(--sd-border, #dde1e7);
	border-radius: 6px;
	padding: 1rem;
	margin-bottom: 0.75rem;
}

.sd-consent-required {
	border-color: #fbbf24;
	background: #fffbeb;
}

/* ===== RIGHE RIPETIBILI ===== */
.sd-repeatable-row {
	background: #f9fafb;
	border: 1px solid var(--sd-border, #dde1e7);
	border-radius: 6px;
	padding: 1rem;
	margin-bottom: 0.75rem;
}

.sd-row-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}

.sd-remove-row {
	background: none;
	border: 1px solid #dc2626;
	color: #dc2626;
	cursor: pointer;
	border-radius: 4px;
	padding: 0.2rem 0.5rem;
	font-size: 0.8rem;
	transition: background 0.15s;
}

.sd-remove-row:hover {
	background: #dc2626;
	color: #fff;
}

/* ===== TAG INPUT (allergie) ===== */
.sd-tag-input-wrap {
	border: 1px solid var(--sd-border, #dde1e7);
	border-radius: 6px;
	padding: 0.5rem;
	background: #fff;
}

.sd-tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 0.35rem;
	min-height: 24px;
}

.sd-tag {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.2rem 0.6rem;
	background: #dbeafe;
	color: #1d4ed8;
	border-radius: 100px;
	font-size: 0.82rem;
	font-weight: 500;
}

.sd-tag button {
	background: none;
	border: none;
	cursor: pointer;
	color: #1d4ed8;
	padding: 0;
	font-size: 0.8rem;
	line-height: 1;
}

.sd-tag-input {
	border: none !important;
	box-shadow: none !important;
	padding: 0.2rem !important;
}

/* ===== BADGE ===== */
.sd-badge {
	display: inline-block;
	padding: 0.15rem 0.6rem;
	border-radius: 100px;
	font-size: 0.75rem;
	font-weight: 600;
}

.sd-badge-warning {
	background: #fef3c7;
	color: #92400e;
}

.sd-badge-blue {
	background: #dbeafe;
	color: #1e40af;
}

.sd-badge-orange {
	background: #fff7ed;
	color: #c2410c;
}

/* ===== PULSANTI ===== */
.sd-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.6rem 1.2rem;
	border: none;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, box-shadow 0.15s;
}

.sd-btn-primary {
	background: var(--sd-primary, #0055a5);
	color: #fff;
}

.sd-btn-primary:hover {
	background: #004185;
	box-shadow: 0 2px 8px rgba(0, 85, 165, 0.3);
}

.sd-btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 1px solid var(--sd-border, #dde1e7);
}

.sd-btn-secondary:hover {
	background: #e5e7eb;
}

.sd-btn-danger {
	background: #dc2626;
	color: #fff;
}

.sd-btn-danger:hover {
	background: #b91c1c;
}

.sd-btn-sm {
	padding: 0.35rem 0.8rem;
	font-size: 0.82rem;
}

.sd-btn-large {
	padding: 0.8rem 2rem;
	font-size: 1rem;
}

/* ===== NOTICE ===== */
.sd-notice {
	padding: 0.75rem 1rem;
	border-radius: 6px;
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

.sd-notice-success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #6ee7b7;
}

.sd-notice-error {
	background: #fee2e2;
	color: #7f1d1d;
	border: 1px solid #fca5a5;
}

.sd-notice-warning {
	background: #fef3c7;
	color: #78350f;
	border: 1px solid #fde68a;
}

.sd-notice-info {
	background: #dbeafe;
	color: #1e3a5f;
	border: 1px solid #93c5fd;
}

/* ===== FOOTER FORM ===== */
.sd-form-footer {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding-top: 1rem;
	flex-wrap: wrap;
}

/* ===== MINOR SECTION ===== */
.sd-minor-section {
	border-color: #fbbf24;
	background: #fffbeb;
}

/* ===== MEDICATIONS TABLE ===== */
.sd-medications-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
}

.sd-medications-table th,
.sd-medications-table td {
	padding: 0.4rem 0.6rem;
	border: 1px solid var(--sd-border, #dde1e7);
	text-align: left;
}

.sd-medications-table th {
	background: #f3f4f6;
	font-weight: 600;
}

.sd-medications-table tr.sd-suspended td {
	color: #9ca3af;
	text-decoration: line-through;
}

/* ===== READONLY DISPLAY ===== */
.sd-readonly-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	padding: 0.5rem 0;
}

.sd-info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 0.5rem;
}

.sd-info-row {
	display: flex;
	gap: 0.5rem;
	padding: 0.35rem 0;
	font-size: 0.88rem;
}

.sd-info-label {
	font-weight: 600;
	color: #6b7280;
	min-width: 130px;
	flex-shrink: 0;
}

.sd-info-value {
	color: #111827;
}

/* ===== LOADING ===== */
.sd-loading {
	text-align: center;
	padding: 2rem;
	color: var(--sd-muted, #6b7280);
	font-style: italic;
}

/* ===== TABS ===== */
.sd-tabs {
	display: flex;
	gap: 0.25rem;
	border-bottom: 2px solid var(--sd-border, #dde1e7);
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.sd-tab-btn {
	padding: 0.6rem 1rem;
	border: none;
	background: none;
	cursor: pointer;
	font-size: 0.88rem;
	font-weight: 500;
	color: #6b7280;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s;
}

.sd-tab-btn:hover {
	color: var(--sd-primary, #0055a5);
}

.sd-tab-btn.active {
	color: var(--sd-primary, #0055a5);
	border-bottom-color: var(--sd-primary, #0055a5);
	font-weight: 600;
}

.sd-tab-content {
	display: none;
}

.sd-tab-content.active {
	display: block;
}

/* ===== BREADCRUMB ===== */
.sd-breadcrumb {
	margin-bottom: 0.5rem;
}

.sd-back-link {
	font-size: 0.85rem;
	color: var(--sd-muted, #6b7280);
	text-decoration: none;
}

.sd-back-link:hover {
	color: var(--sd-primary, #0055a5);
}

/* ===== MEMBER ID ===== */
.sd-member-id {
	font-size: 0.8rem;
	color: var(--sd-muted, #6b7280);
	font-weight: 400;
	margin-left: 0.5rem;
}

.sd-member-badges {
	display: flex;
	gap: 0.4rem;
	margin-top: 0.5rem;
}

/* ===== EDIT FOOTER ===== */
.sd-edit-footer {
	background: #f9fafb;
	border-top: 1px solid var(--sd-border, #dde1e7);
	padding: 1rem 0;
	margin-top: 1rem;
	position: sticky;
	bottom: 0;
}
