/**
 * Simple RSVP — Public Styles
 *
 * Uses CSS Custom Properties set inline on .srsvp-wrapper.
 * Colors come from the template preset or user overrides.
 */

/* === Reset & Base === */
.srsvp-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
	line-height: 1.6;
	color: var(--srsvp-text, #1F2937);
	max-width: 640px;
	margin: 0 auto;
	padding: 20px;
}

.srsvp-wrapper *,
.srsvp-wrapper *::before,
.srsvp-wrapper *::after {
	box-sizing: border-box;
}

/* === Card Container === */
.srsvp-card {
	background: var(--srsvp-bg, #FDF2F8);
	border-radius: 16px;
	overflow: hidden;
}

.srsvp-card-header {
	background: var(--srsvp-primary, #9333EA);
	color: var(--srsvp-btn-text, #FFFFFF);
	text-align: center;
	padding: 28px 24px;
}

.srsvp-card-title {
	font-size: 1.5em;
	font-weight: 600;
	margin: 0 0 6px;
	font-style: italic;
	font-family: Georgia, 'Times New Roman', serif;
	color: inherit;
}

.srsvp-card-subtitle {
	font-size: 0.9em;
	margin: 0;
	opacity: 0.9;
	color: inherit;
}

.srsvp-card-body {
	padding: 32px 28px 24px;
	color: var(--srsvp-text, #1F2937);
}

.srsvp-card-footer {
	padding: 20px 28px;
	text-align: center;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.srsvp-footer-deadline {
	font-size: 0.85em;
	color: var(--srsvp-text, #1F2937);
	margin: 0 0 8px;
	font-weight: 500;
}

/* === Powered By === */
.srsvp-powered-by {
	text-align: center;
	font-size: 0.72em;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.45;
	margin: 0;
}

.srsvp-powered-by a {
	color: var(--srsvp-primary, #9333EA);
	text-decoration: none;
	font-weight: 500;
}

.srsvp-powered-by a:hover {
	text-decoration: underline;
}

/* === Event Card === */
.srsvp-event-card {
	margin-bottom: 24px;
}

.srsvp-cover {
	width: 100%;
	max-height: 300px;
	overflow: hidden;
}

.srsvp-cover img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
}

.srsvp-event-details {
	text-align: center;
}

.srsvp-event-name {
	font-size: 1.8em;
	font-weight: 800;
	color: var(--srsvp-primary, #9333EA);
	margin: 0 0 12px;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.srsvp-event-desc {
	font-size: 1em;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.8;
	margin: 0 0 20px;
	max-width: 480px;
	margin-left: auto;
	margin-right: auto;
}

.srsvp-meta {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: center;
	margin-bottom: 24px;
}

.srsvp-meta-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.95em;
	color: var(--srsvp-text, #1F2937);
}

.srsvp-meta-icon {
	font-size: 1.1em;
}

.srsvp-meta-sep {
	opacity: 0.4;
}

.srsvp-map-link {
	color: var(--srsvp-primary, #9333EA);
	text-decoration: none;
	font-weight: 500;
}

.srsvp-map-link:hover {
	text-decoration: underline;
}

/* === Countdown === */
.srsvp-countdown {
	display: flex;
	justify-content: center;
	gap: 16px;
	margin-top: 20px;
}

.srsvp-countdown-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 64px;
}

.srsvp-cd-number {
	font-size: 2em;
	font-weight: 800;
	color: var(--srsvp-primary, #9333EA);
	line-height: 1;
	margin-bottom: 4px;
	font-variant-numeric: tabular-nums;
}

.srsvp-cd-label {
	font-size: 0.7em;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.5;
	font-weight: 600;
}

/* === Lookup Step === */
.srsvp-lookup-header {
	text-align: center;
	margin-bottom: 28px;
}

.srsvp-lookup-icon {
	font-size: 3em;
	margin-bottom: 12px;
}

.srsvp-lookup-title {
	font-size: 1.25em;
	font-weight: 700;
	color: inherit;
	margin: 0 0 8px;
}

.srsvp-lookup-prompt {
	font-size: 0.9em;
	color: inherit;
	opacity: 0.65;
	margin: 0;
}

.srsvp-lookup-form {
	max-width: 400px;
	margin: 0 auto;
}

/* === Form Fields === */
.srsvp-field {
	margin-bottom: 16px;
	text-align: left;
}

.srsvp-input-wrapper {
	position: relative;
}

.srsvp-input-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.1em;
	opacity: 0.4;
	pointer-events: none;
}

.srsvp-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	font-size: 0.88em;
	color: inherit;
	margin-bottom: 8px;
}

.srsvp-label-icon {
	font-size: 1.1em;
}

.srsvp-label-optional {
	font-weight: 400;
	opacity: 0.5;
	margin-left: 4px;
}

.srsvp-input {
	width: 100%;
	padding: 14px 16px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-radius: 12px;
	font-size: 1em;
	font-family: inherit;
	background: rgba(0, 0, 0, 0.03);
	color: inherit;
	transition: border-color 0.2s, background 0.2s;
}

.srsvp-input-search {
	padding-right: 44px;
}

.srsvp-input-code {
	text-transform: uppercase;
	letter-spacing: 4px;
	text-align: center;
	font-family: 'Fira Code', 'Consolas', monospace;
}

.srsvp-input:focus {
	outline: none;
	border-color: var(--srsvp-primary, #9333EA);
	background: #FFFFFF;
}

.srsvp-input::placeholder {
	color: var(--srsvp-text, #1F2937);
	opacity: 0.4;
}

.srsvp-field-hint {
	font-size: 0.78em;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.5;
	margin: 8px 0 0;
	text-align: center;
}

.srsvp-textarea {
	resize: vertical;
	min-height: 90px;
}

/* === Divider === */
.srsvp-divider {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 20px 0;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.6;
	font-size: 0.85em;
}

.srsvp-divider::before,
.srsvp-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--srsvp-text, #1F2937);
	opacity: 0.2;
}

/* === Buttons === */
.srsvp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 32px;
	border: none;
	border-radius: 12px;
	font-size: 1em;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: opacity 0.15s;
	width: 100%;
}

.srsvp-btn:hover {
	opacity: 0.9;
}

.srsvp-btn:active {
	transform: translateY(0);
}

.srsvp-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.srsvp-btn-primary {
	background: var(--srsvp-btn, #9333EA);
	color: var(--srsvp-btn-text, #FFFFFF);
}

.srsvp-btn-submit {
	margin-top: 8px;
}

.srsvp-btn-icon {
	font-size: 1.1em;
}

.srsvp-btn-loading {
	display: inline-flex;
	align-items: center;
}

.srsvp-btn-link {
	color: var(--srsvp-primary, #9333EA);
	text-decoration: none;
	font-size: 0.88em;
	font-weight: 500;
}

.srsvp-btn-link:hover {
	text-decoration: underline;
}

/* Spinner */
.srsvp-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #FFFFFF;
	border-radius: 50%;
	animation: srsvp-spin 0.6s linear infinite;
}

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

/* === Not Found State === */
.srsvp-not-found {
	text-align: center;
	padding: 24px 0;
}

.srsvp-not-found-icon {
	font-size: 2.5em;
	margin-bottom: 12px;
}

.srsvp-not-found-title {
	font-weight: 700;
	font-size: 1.05em;
	color: inherit;
	margin-bottom: 8px;
}

.srsvp-not-found-desc {
	font-size: 0.9em;
	color: inherit;
	opacity: 0.7;
	max-width: 320px;
	margin: 0 auto;
}

/* === Welcome Banner === */
.srsvp-welcome-banner {
	background: var(--srsvp-bg, #FDF2F8);
	border: 2px solid var(--srsvp-primary, #9333EA);
	border-radius: 14px;
	padding: 24px;
	text-align: center;
	margin-bottom: 28px;
	opacity: 0.95;
}

.srsvp-welcome-greeting {
	font-size: 0.78em;
	color: var(--srsvp-primary, #9333EA);
	text-transform: uppercase;
	letter-spacing: 2px;
	font-weight: 700;
	margin-bottom: 4px;
}

.srsvp-welcome-name {
	font-size: 1.5em;
	font-weight: 700;
	color: inherit;
	margin: 0 0 12px;
}

.srsvp-welcome-change {
	display: inline-block;
	font-size: 0.82em;
	color: var(--srsvp-primary, #9333EA);
	text-decoration: none;
	cursor: pointer;
}

.srsvp-welcome-change:hover {
	text-decoration: underline;
}

/* === Attendance Choices === */
.srsvp-attendance-choices {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	justify-content: center;
	flex-wrap: wrap;
}

.srsvp-choice {
	flex: 1;
	min-width: 130px;
	padding: 18px 14px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-radius: 14px;
	background: #FFFFFF;
	cursor: pointer;
	transition: all 0.2s;
	font-family: inherit;
	text-align: center;
}

.srsvp-choice:hover {
	border-color: var(--srsvp-primary, #9333EA);
}

.srsvp-choice.active {
}

.srsvp-choice-yes.active {
	border-color: #10B981;
	background: #D1FAE5;
}

.srsvp-choice-no.active {
	border-color: #EF4444;
	background: #FEE2E2;
}

.srsvp-choice-maybe.active {
	border-color: #F59E0B;
	background: #FEF3C7;
}

.srsvp-choice-icon {
	display: block;
	font-size: 1.6em;
	margin-bottom: 6px;
}

.srsvp-choice-label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	color: inherit;
}

/* === Meal Options === */
.srsvp-meal-options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.srsvp-meal-option {
	display: inline-flex;
	cursor: pointer;
}

.srsvp-meal-option input[type="radio"] {
	display: none;
}

.srsvp-meal-label {
	display: inline-block;
	padding: 10px 16px;
	border: 2px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	font-size: 0.88em;
	font-weight: 500;
	background: #FFFFFF;
	transition: all 0.15s;
	color: inherit;
}

.srsvp-meal-option input[type="radio"]:checked + .srsvp-meal-label {
	border-color: var(--srsvp-primary, #9333EA);
	background: #F5F3FF;
	color: var(--srsvp-primary, #9333EA);
	font-weight: 600;
}

.srsvp-meal-label:hover {
	border-color: var(--srsvp-primary, #9333EA);
}

/* === Notices === */
.srsvp-notice {
	padding: 14px 18px;
	border-radius: 12px;
	font-size: 0.9em;
	margin-top: 16px;
	text-align: center;
}

.srsvp-notice-error {
	background: #FEE2E2;
	color: #991B1B;
	border: 1px solid #FECACA;
}

.srsvp-notice-info {
	background: #DBEAFE;
	color: #1E40AF;
	border: 1px solid #93C5FD;
	margin-bottom: 24px;
}

/* === Deadline Note === */
.srsvp-deadline-note {
	text-align: center;
	font-size: 0.82em;
	color: inherit;
	opacity: 0.6;
	margin: 16px 0 0;
}

/* === Success Step === */
.srsvp-step-success {
	padding: 20px 0;
}

.srsvp-success-content {
	text-align: center;
}

.srsvp-success-icon {
	font-size: 4em;
	margin-bottom: 16px;
	animation: srsvp-pop 0.4s ease-out;
}

@keyframes srsvp-pop {
	0% { transform: scale(0.5); opacity: 0; }
	70% { transform: scale(1.1); }
	100% { transform: scale(1); opacity: 1; }
}

.srsvp-success-title {
	font-size: 1.5em;
	font-weight: 700;
	color: inherit;
	margin: 0 0 8px;
}

.srsvp-success-message {
	font-size: 0.95em;
	color: inherit;
	opacity: 0.8;
	margin: 0 0 24px;
	max-width: 400px;
	margin-left: auto;
	margin-right: auto;
}

.srsvp-success-details {
	background: var(--srsvp-bg, #FDF2F8);
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 12px;
	padding: 20px;
	text-align: left;
	margin-bottom: 24px;
}

.srsvp-success-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	font-size: 0.9em;
}

.srsvp-success-row:last-child {
	border-bottom: none;
}

.srsvp-success-actions {
	margin-top: 20px;
}

/* === Closed State === */
.srsvp-closed {
	text-align: center;
	padding: 48px 28px;
}

.srsvp-closed-icon {
	font-size: 3em;
	margin-bottom: 12px;
}

.srsvp-closed-title {
	font-size: 1.3em;
	font-weight: 700;
	color: var(--srsvp-primary, #9333EA);
	margin: 0 0 8px;
}

.srsvp-closed-message {
	font-size: 0.95em;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.7;
	margin: 0;
}

/* === Extra Fields Animation === */
.srsvp-extra-fields {
	animation: srsvp-slide-in 0.3s ease-out;
}

@keyframes srsvp-slide-in {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* === Step Transitions === */
.srsvp-step {
	animation: srsvp-fade-in 0.3s ease-out;
}

@keyframes srsvp-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* === Legacy Support (for old templates) === */
.srsvp-form-section {
	background: var(--srsvp-bg, #FDF2F8);
	border-radius: 16px;
	padding: 36px 28px;
	text-align: center;
}

.srsvp-form-title {
	font-size: 1.4em;
	font-weight: 700;
	color: var(--srsvp-primary, #9333EA);
	margin: 0 0 6px;
}

.srsvp-form-subtitle {
	font-size: 0.95em;
	color: var(--srsvp-text, #1F2937);
	opacity: 0.7;
	margin: 0 0 28px;
}

.srsvp-guest-welcome {
	margin-bottom: 24px;
}

/* === Responsive === */
@media (max-width: 480px) {
	.srsvp-wrapper {
		padding: 12px;
	}

	.srsvp-card-header {
		padding: 24px 20px;
	}

	.srsvp-card-body {
		padding: 24px 20px;
	}

	.srsvp-card-footer {
		padding: 14px 20px;
	}

	.srsvp-card-title {
		font-size: 1.3em;
	}

	.srsvp-event-details {
		padding: 24px 16px;
	}

	.srsvp-event-name {
		font-size: 1.4em;
	}

	.srsvp-attendance-choices {
		flex-direction: column;
	}

	.srsvp-choice {
		min-width: auto;
	}

	.srsvp-countdown {
		gap: 10px;
	}

	.srsvp-cd-number {
		font-size: 1.5em;
	}

	.srsvp-welcome-name {
		font-size: 1.3em;
	}
}
