/* ==========================================================================
   FORM SECTION STYLES
   Matches United School of Tokyo (UST) Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SECTION BASE & CONTAINERS
   -------------------------------------------------------------------------- */
.ust-form-section {
	width: 100%;
	position: relative;
	padding: 50px 20px;
	background-color: #ffffff;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	color: #1e293b;
	overflow: hidden;
}

.ust-form-section-container {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
}



.ust-form-section-centered-wrapper {
	max-width: 800px;
	margin: 0 auto;
	width: 100%;
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY & HEADINGS
   -------------------------------------------------------------------------- */
.ust-form-header {
	margin-bottom: 36px;
}

.ust-form-header.ust-text-center,
.ust-text-center {
	text-align: center;
}

.ust-form-eyebrow {
	display: inline-block;
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--astro-primary, #E06D2C);
	margin-bottom: 12px;
}

.ust-form-title {
	font-family: var(--astro-font-serif, 'Cinzel', serif);
	font-size: 34px;
	font-weight: 700;
	color: var(--astro-heading, #1C1917);
	letter-spacing: -0.01em;
	line-height: 1.1;
	margin: 0 0 16px 0;
	text-transform: uppercase;
	max-width: 480px;
}

@media (min-width: 768px) {
	.ust-form-title {
		font-size: 44px;
	}
}

.ust-form-subheading {
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 18px;
	color: var(--ust-section-text-color, #475569);
	font-style: italic;
	line-height: 1.5;
	margin: 0 0 16px 0;
}

.ust-form-description {
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 17px;
	color: var(--astro-body, #44403C);
	line-height: 1.6;
	margin-bottom: 24px;
	max-width: 480px;
}

.ust-form-description p {
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 17px;
	line-height: 1.6;
	margin: 0 0 16px 0;
}

.ust-form-description p:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   3. BUTTON STYLES
   -------------------------------------------------------------------------- */
.ust-form-btn-wrapper {
	margin-top: 24px;
}

.ust-form-btn-wrapper.ust-text-center {
	text-align: center;
}

.ust-form-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 28px;
	font-family: 'Roboto', sans-serif;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 6px;
	transition: all 0.25s ease;
	cursor: pointer;
	border: 2px solid transparent;
	line-height: 1.4;
}

.ust-btn-primary {
	background-color: #3B4DA0;
	color: #ffffff;
	border-color: #3B4DA0;
}

.ust-btn-primary:hover {
	background-color: #2b3a80;
	border-color: #2b3a80;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(59, 77, 160, 0.35);
	transform: translateY(-2px);
}

.ust-btn-secondary {
	background-color: #0f172a;
	color: #ffffff;
	border-color: #0f172a;
}

.ust-btn-secondary:hover {
	background-color: #1e293b;
	border-color: #1e293b;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.35);
	transform: translateY(-2px);
}

.ust-btn-outline {
	background-color: transparent;
	color: #3B4DA0;
	border-color: #3B4DA0;
}

.ust-btn-outline:hover {
	background-color: #3B4DA0;
	color: #ffffff;
	transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   3.5 CONTENT SPECIFIC STYLES (Quotes & Dividers)
   -------------------------------------------------------------------------- */
hr.ust-contact-divider {
	border: none;
	border-top: 1px solid var(--astro-border, #e2e8f0);
	margin: 2rem 0;
}

.ust-form-description blockquote {
	margin: 0 0 1.5rem 0;
	padding: 0;
	border: none;
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-style: italic;
	font-size: 20px;
	line-height: 1.5;
	color: var(--astro-primary, #E06D2C);
	position: relative;
	max-width: 480px;
}

.ust-form-description blockquote cite {
	display: block;
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-style: normal;
	font-weight: 600;
	font-size: 15px;
	color: var(--astro-text-muted, #57534E);
	margin-top: 1rem;
}

/* --------------------------------------------------------------------------
   4. LAYOUT GRIDS & COLUMNS
   -------------------------------------------------------------------------- */
.ust-form-grid {
	display: flex;
	gap: 48px;
	align-items: center;
	width: 100%;
}

.ust-form-content-col,
.ust-form-image-col,
.ust-form-box-col {
	flex: 1 1 0;
	min-width: 0;
}

.ust-form-content-col {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.ust-form-content-col > *:last-child {
	margin-bottom: 0;
}

/* Column Swapping for Form Left Layouts (Desktop) */
@media (min-width: 992px) {
	.ust-form-layout-form_left_content_right .ust-form-grid,
	.ust-form-layout-form_left_image_right .ust-form-grid {
		flex-direction: row-reverse;
	}

	/* Contact Us Background Split layout */
	.ust-form-layout-content_left_form_right.ust-form-section {
		padding: 40px 20px;
		background-color: #ffffff; /* Ensure the right side stays white */
	}


	.ust-form-layout-content_left_form_right .ust-form-section-container {
		position: relative;
		z-index: 1;
	}

	.ust-form-layout-content_left_form_right .ust-form-grid {
		align-items: center;
		flex-direction: row !important; /* Explicitly enforce Content Left, Form Right */
	}

	.ust-form-layout-content_left_form_right .ust-form-content-col {
		padding: 24px 48px 24px 0;
	}
}

@media (max-width: 991px) {

	.ust-form-layout-content_left_form_right .ust-form-content-col {
		padding: 32px;
		background-color: rgba(255, 255, 255, 0.85); /* Readability layer for text over image on mobile */
		border-radius: 12px;
		margin-top: 20px;
	}
}

/* --------------------------------------------------------------------------
   5. IMAGE CONTAINER
   -------------------------------------------------------------------------- */
.ust-form-image-wrapper {
	margin: 0;
	width: 100%;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
	background-color: #f8fafc;
}

.ust-form-image-wrapper img {
	width: 100%;
	height: auto;
	object-fit: cover;
	display: block;
}

.ust-form-image-caption {
	padding: 12px 16px;
	font-size: 14px;
	color: #64748b;
	background-color: #f8fafc;
	font-style: italic;
	border-top: 1px solid #e2e8f0;
}

/* --------------------------------------------------------------------------
   6. FORM CARD / BOX WRAPPER
   -------------------------------------------------------------------------- */
.ust-form-box {
	background-color: #ffffff;
	border-radius: 12px;
	padding: 40px 40px 24px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
	border: none;
	transition: box-shadow 0.3s ease;
	width: 100%;
	max-width: 680px;
	margin-left: auto;
}

.ust-form-box:hover {
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.09);
}

/* Placeholder Notice for Admin when form not selected or plugin missing */
.ust-form-placeholder-notice {
	background-color: #eff6ff;
	border: 1px dashed #3B4DA0;
	border-radius: 8px;
	padding: 20px;
	color: #1e3a8a;
	font-size: 14px;
	text-align: center;
}

.ust-form-placeholder-notice p {
	margin: 0;
}

/* --------------------------------------------------------------------------
   7. CONTACT FORM 7 STYLING (MATCHING ASTROLOGY REFERENCE)
   -------------------------------------------------------------------------- */
.ust-form-box .wpcf7 {
	margin: 0;
	padding: 0;
}

.ust-form-box .wpcf7-form {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px 24px;
}

.ust-form-box .wpcf7-form > p,
.ust-form-box .wpcf7-form > div {
	margin: 0;
	width: 100%;
}

.ust-form-box .wpcf7-form br {
	display: none;
}

/* Force labels above inputs */
.ust-form-box .wpcf7-form label {
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 18px;
	font-weight: 400;
	color: #0f172a;
	margin-bottom: 0;
}

/* Form Inputs, Selects & Textareas */
.ust-form-box input[type="text"],
.ust-form-box input[type="email"],
.ust-form-box input[type="url"],
.ust-form-box input[type="tel"],
.ust-form-box input[type="number"],
.ust-form-box input[type="password"],
.ust-form-box input[type="date"],
.ust-form-box input[type="time"],
.ust-form-box select,
.ust-form-box textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	padding: 14px 18px;
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 16px;
	color: #0f172a;
	background-color: #F8FAFC;
	border: 1px solid #E2E8F0;
	border-radius: 8px;
	height: 56px;
	outline: none;
	transition: all 0.2s ease-in-out;
}

/* Ensure CF7 span wrappers don't collapse width */
.ust-form-box .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

.ust-form-box textarea {
	height: 100px;
	min-height: 100px;
	resize: vertical;
}

.ust-form-box input[type="text"]:focus,
.ust-form-box input[type="email"]:focus,
.ust-form-box input[type="url"]:focus,
.ust-form-box input[type="tel"]:focus,
.ust-form-box input[type="number"]:focus,
.ust-form-box input[type="date"]:focus,
.ust-form-box input[type="time"]:focus,
.ust-form-box select:focus,
.ust-form-box textarea:focus {
	background-color: #ffffff;
	border-color: var(--astro-primary, #e06d2c);
	box-shadow: 0 0 0 3px rgba(224, 109, 44, 0.15);
}

/* Full width fields: Message and Submit button */
.ust-form-box .wpcf7-form p:has(textarea),
.ust-form-box .wpcf7-form div:has(textarea),
.ust-form-box .wpcf7-form p:has(input[type="submit"]),
.ust-form-box .wpcf7-form div:has(input[type="submit"]) {
	grid-column: 1 / -1;
}

/* Avoid empty space from hidden response outputs */
.ust-form-box .wpcf7-response-output,
.ust-form-box .wpcf7-spinner {
	grid-column: 1 / -1;
	margin: 0 !important;
}

.ust-form-box .wpcf7-not-valid-tip {
	font-size: 13px;
	color: #e11d48;
	margin-top: 6px;
}

/* Submit Button */
.ust-form-box input[type="submit"] {
	width: 100%;
	height: 58px;
	padding: 0 32px;
	font-family: var(--astro-font-sans, 'Plus Jakarta Sans', sans-serif);
	font-size: 18px;
	font-weight: 700;
	color: #ffffff;
	background-color: var(--astro-primary, #E06D2C);
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.25s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-top: 8px;
}

.ust-form-box input[type="submit"]:hover {
	background-color: var(--astro-primary-hover, #c85a17);
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(224, 109, 44, 0.35);
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE DESIGN & MOBILE STYLES
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
	.ust-form-section {
		padding: 35px 16px;
	}

	.ust-form-grid {
		flex-direction: column !important;
		gap: 36px;
	}

	.ust-form-content-col,
	.ust-form-image-col,
	.ust-form-box-col {
		width: 100%;
		flex: none;
	}

	.ust-form-box {
		padding: 28px 24px 16px;
		margin: 0 auto;
	}
}

@media (max-width: 576px) {
	.ust-form-section {
		padding: 28px 14px;
	}

	.ust-form-title {
		font-size: 30px;
	}

	.ust-form-subheading {
		font-size: 16px;
	}

	.ust-form-box {
		padding: 20px 16px;
		border-radius: 10px;
	}

	.ust-form-btn {
		width: 100%;
	}

	.ust-form-box .wpcf7-form {
		grid-template-columns: 1fr;
	}
}
