/* ==========================================================================
   Susrut Feedback Portal — Mobile-first stylesheet
   ========================================================================== */

/* ── Reset / base ──────────────────────────────────────────────────────── */
.sf-wrapper *,
.sf-wrapper *::before,
.sf-wrapper *::after {
	box-sizing: border-box;
}

.sf-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a202c;
	background: #f7fafc;
	min-height: 100vh;
	padding: 0 0 48px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.sf-header {
	background: #1a5276;
	color: #fff;
	padding: 20px 20px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	position: sticky;
	top: 0;
	z-index: 10;
	box-shadow: 0 2px 8px rgba(0,0,0,.20);
}

.sf-logo-area {
	display: flex;
	align-items: center;
	gap: 12px;
}

.sf-logo {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: contain;
	background: #fff;
	padding: 2px;
}

.sf-title-group {
	display: flex;
	flex-direction: column;
}

.sf-site-name {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
}

.sf-subtitle {
	margin: 0;
	font-size: .75rem;
	opacity: .85;
	color: #d6eaf8;
}

/* Visit type badge */
.sf-visit-badge {
	font-size: .7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	padding: 4px 10px;
	border-radius: 20px;
	white-space: nowrap;
	flex-shrink: 0;
}

.sf-visit-pres  { background: #d5f5e3; color: #1e8449; }
.sf-visit-disch { background: #d6eaf8; color: #1a5276; }

/* ── Patient card ──────────────────────────────────────────────────────── */
.sf-patient-card {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	margin: 16px 16px 0;
	padding: 14px 16px;
	border-radius: 10px;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.sf-patient-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #1a5276;
	color: #fff;
	font-size: 1.2rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.sf-patient-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.sf-patient-name {
	font-weight: 600;
	font-size: .95rem;
}

.sf-patient-meta {
	font-size: .78rem;
	color: #718096;
}

/* ── Form container ────────────────────────────────────────────────────── */
.sf-form {
	background: #fff;
	margin: 16px 16px 0;
	padding: 20px 16px 24px;
	border-radius: 10px;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── Field ─────────────────────────────────────────────────────────────── */
.sf-field {
	margin-bottom: 24px;
}

.sf-label {
	display: block;
	font-weight: 600;
	font-size: .88rem;
	margin-bottom: 10px;
	color: #2d3748;
}

.sf-req    { color: #e53e3e; }
.sf-optional { font-weight: 400; color: #a0aec0; font-size: .8rem; }

/* ── Star rating ───────────────────────────────────────────────────────── */
.sf-stars {
	display: flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 4px;
}

.sf-star-input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.sf-star-label {
	font-size: 2.6rem;
	color: #d1d5db;
	cursor: pointer;
	transition: color .15s, transform .12s;
	-webkit-tap-highlight-color: transparent;
	line-height: 1;
}

/* Highlight hovered star and all stars before it (row-reverse means siblings after in DOM) */
.sf-star-label:hover,
.sf-star-label:hover ~ .sf-star-label,
.sf-star-input:checked ~ .sf-star-label {
	color: #f6ad55;
}

.sf-star-label:hover {
	transform: scale(1.15);
}

.sf-star-hint {
	margin: 8px 0 0;
	font-size: .78rem;
	color: #a0aec0;
}

/* ── Radio group ───────────────────────────────────────────────────────── */
.sf-radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.sf-radio-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: .9rem;
	padding: 8px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	transition: border-color .15s, background .15s;
	-webkit-tap-highlight-color: transparent;
}

.sf-radio-label:hover {
	border-color: #1a5276;
}

.sf-radio {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.sf-radio-btn {
	width: 18px;
	height: 18px;
	border: 2px solid #cbd5e0;
	border-radius: 50%;
	flex-shrink: 0;
	transition: border-color .15s;
	position: relative;
}

.sf-radio:checked + .sf-radio-btn {
	border-color: #1a5276;
}

.sf-radio:checked + .sf-radio-btn::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 8px;
	height: 8px;
	background: #1a5276;
	border-radius: 50%;
}

.sf-radio-label:has(.sf-radio:checked) {
	border-color: #1a5276;
	background: #ebf4fb;
}

/* ── Checkbox group ────────────────────────────────────────────────────── */
.sf-check-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.sf-check-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: .9rem;
	padding: 8px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	transition: border-color .15s, background .15s;
	-webkit-tap-highlight-color: transparent;
}

.sf-check-label:hover {
	border-color: #1a5276;
}

.sf-checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.sf-check-btn {
	width: 18px;
	height: 18px;
	border: 2px solid #cbd5e0;
	border-radius: 4px;
	flex-shrink: 0;
	transition: border-color .15s, background .15s;
	position: relative;
}

.sf-checkbox:checked + .sf-check-btn {
	background: #1a5276;
	border-color: #1a5276;
}

.sf-checkbox:checked + .sf-check-btn::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 5px;
	width: 5px;
	height: 9px;
	border: 2px solid #fff;
	border-top: none;
	border-left: none;
	transform: rotate(45deg);
}

.sf-check-label:has(.sf-checkbox:checked) {
	border-color: #1a5276;
	background: #ebf4fb;
}

/* ── Textarea ──────────────────────────────────────────────────────────── */
.sf-textarea {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: .9rem;
	font-family: inherit;
	resize: vertical;
	transition: border-color .15s;
	line-height: 1.5;
	color: #2d3748;
}

.sf-textarea:focus {
	outline: none;
	border-color: #1a5276;
}

.sf-char-count {
	margin: 4px 0 0;
	font-size: .75rem;
	color: #a0aec0;
	text-align: right;
}

/* ── Text input ────────────────────────────────────────────────────────── */
.sf-input {
	width: 100%;
	padding: 12px 14px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: .9rem;
	font-family: inherit;
	transition: border-color .15s;
	color: #2d3748;
}

.sf-input:focus {
	outline: none;
	border-color: #1a5276;
}

/* ── Status messages ───────────────────────────────────────────────────── */
.sf-messages {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 16px;
	font-size: .88rem;
	font-weight: 500;
}

.sf-messages--error {
	background: #fff5f5;
	border: 1px solid #feb2b2;
	color: #c53030;
}

.sf-messages--success {
	background: #f0fff4;
	border: 1px solid #9ae6b4;
	color: #276749;
}

/* ── Submit button ─────────────────────────────────────────────────────── */
.sf-submit-btn {
	width: 100%;
	padding: 14px;
	background: #1a5276;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s, transform .1s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	-webkit-tap-highlight-color: transparent;
}

.sf-submit-btn:hover:not(:disabled) {
	background: #154360;
}

.sf-submit-btn:active:not(:disabled) {
	transform: scale(.98);
}

.sf-submit-btn:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* Spinner */
.sf-btn-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: sf-spin .7s linear infinite;
}

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

/* ── Success overlay ───────────────────────────────────────────────────── */
.sf-success {
	background: #fff;
	margin: 16px 16px 0;
	padding: 40px 24px;
	border-radius: 10px;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.sf-success-inner {
	text-align: center;
}

.sf-success-icon {
	width: 72px;
	height: 72px;
	background: #1a5276;
	color: #fff;
	border-radius: 50%;
	font-size: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.sf-success-title {
	font-size: 1.5rem;
	font-weight: 700;
	color: #1a5276;
	margin: 0 0 12px;
}

.sf-success-msg {
	color: #4a5568;
	font-size: .95rem;
	line-height: 1.6;
	margin: 0 0 16px;
}

.sf-success-sub {
	font-size: .82rem;
	color: #a0aec0;
	margin: 0;
}

/* ── Error wrapper ─────────────────────────────────────────────────────── */
.sf-wrapper--error {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 20px;
}

.sf-error-inner {
	text-align: center;
	background: #fff;
	border-radius: 10px;
	padding: 40px 24px;
	max-width: 400px;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.sf-error-icon {
	font-size: 3rem;
	color: #e53e3e;
	margin-bottom: 16px;
}

.sf-error-title {
	font-size: 1.3rem;
	font-weight: 700;
	color: #1a202c;
	margin: 0 0 12px;
}

.sf-error-msg,
.sf-error-sub {
	color: #4a5568;
	font-size: .9rem;
	line-height: 1.6;
	margin: 0 0 10px;
}

/* ── Tablet and up ─────────────────────────────────────────────────────── */
@media (min-width: 600px) {
	.sf-header  { padding: 20px 32px; }
	.sf-patient-card,
	.sf-form,
	.sf-success { margin-left: auto; margin-right: auto; max-width: 560px; }
	.sf-star-label { font-size: 3rem; }
}
