/*
 * Ray’s Contact Form — Core Styles
 * PURPOSE:
 * - Structural safety
 * - Grid behavior
 * - Error visibility
 * - Accessibility
 *
 * THEMES:
 * - Handle colors, borders, spacing, fonts
 * - Must not redefine structure
 */

/* =====================================================
   Global Box Model Safety
===================================================== */

.rayscontact-form,
.rayscontact-form *,
.rayscontact-form *::before,
.rayscontact-form *::after {
	box-sizing: border-box;
}

/* =====================================================
   Grid System
===================================================== */

.rayscontact-grid {
	display: grid;
	gap: var(--rc-gap, 1rem);
	width: 100%;
}

@media (max-width: 600px) {
	.rayscontact-grid {
		grid-template-columns: 1fr !important;
	}
}

/* =====================================================
   Field Wrapper
===================================================== */

.rayscontact-field {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: visible;
}

/* Prevent overflow clipping from aggressive themes */
.rayscontact-field > * {
	max-width: 100%;
}

/* =====================================================
   Labels
===================================================== */

.rayscontact-label {
	display: block;
	line-height: 1.3;
	margin-bottom: 0.35em;
}

.rayscontact-required {
	color: var(--rc-error, #dc2626);
	margin-left: 0.25em;
}

/* =====================================================
   Inputs
===================================================== */

.rayscontact-input,
.rayscontact-textarea,
.rayscontact-select {
	width: 100%;
	max-width: 100%;
	font-size: 1em;
	line-height: 1.4;
	display: block;
}

/* Focus visibility (accessibility baseline) */
.rayscontact-input:focus,
.rayscontact-textarea:focus,
.rayscontact-select:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* =====================================================
   Help Text
===================================================== */

.rayscontact-help {
	font-size: 0.85em;
	line-height: 1.4;
	margin-top: 4px;
	opacity: 0.85;
}

/* =====================================================
   Error State (Field-level)
===================================================== */

.rayscontact-field--error
.rayscontact-input,
.rayscontact-field--error
.rayscontact-textarea,
.rayscontact-field--error
.rayscontact-select {
	border-color: var(--rc-error, #dc2626);
}

.rayscontact-error {
	font-size: 13px;
	line-height: 1.4;
	margin-top: 4px;
	color: #d63638;
}

.rayscontact-invalid {
	border-color: #d63638 !important;
	box-shadow: 0 0 0 1px #d63638;
}

/* =====================================================
   Messages (Form-level)
===================================================== */

.rayscontact-message {
	padding: 0.75em 1em;
	margin-bottom: 1em;
	border-radius: 4px;
}

.rayscontact-success {
	color: var(--rc-success, #16a34a);
}

.rayscontact-error {
	color: var(--rc-error, #dc2626);
}

/* =====================================================
   Actions
===================================================== */

.rayscontact-actions {
	margin-top: 1.25em;
}

.rayscontact-submit {
	cursor: pointer;
}

/* =====================================================
   Defensive Resets
===================================================== */

.rayscontact-input,
.rayscontact-textarea,
.rayscontact-select,
.rayscontact-submit {
	display: block;
}

/* =====================================================
   Builder Field Highlighting
   ===================================================== */

/* Hover state */
.rayscontact-builder-field:hover {
    background-color: #fff9c4; /* light yellow */
    cursor: pointer;
}

/* Active (selected) state */
.rayscontact-builder-field--active {
    background-color: #fff9c4;
}

/* Keep controls visible and clean */
.rayscontact-builder-field button {
    background: #fff;
}

/* =====================================================
   Disabled fields look
   ===================================================== */

.rc-field-disabled {
	opacity: 0.6;
}

.rc-field-disabled input,
.rc-field-disabled textarea,
.rc-field-disabled select {
	cursor: not-allowed;
}

/* ----------------------------------------
   Powered By Branding (Free Version Only)
----------------------------------------- */

.rayscontact-powered-by {
	margin-top: 12px;
	display: flex;
	justify-content: flex-end;
}

/* LIGHT THEME BADGE */

.rayscontact-badge-light a {
	display: inline-block;
	padding: 6px 14px;
	font-size: 12px;
	background: rgba(255, 255, 255, 0.5);
	color: rgba(0, 0, 0, 0.5);
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	transition: all 0.2s ease;
}

.rayscontact-badge-light a:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
	color: #000;
	background: rgba(255, 255, 255, 0.8);
}

/* DARK THEME BADGE */

.rayscontact-badge-dark a {
	display: inline-block;
	padding: 6px 14px;
	font-size: 12px;
	background: rgba(0, 0, 0, 0.5);
	color: rgba(255, 255, 255, 0.5);
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
	transition: all 0.2s ease;
}

.rayscontact-badge-dark a:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
	color: #fff;
	background: rgba(0, 0, 0, 0.8);
}

/* defining minimum height for input fields */
.rayscontact-input,
.rayscontact-select,
.rayscontact-textarea {
	min-height: 42px;
}

/* ----------------------------------------
   Submit Button Baseline
----------------------------------------- */

.rayscontact-submit {
	min-height: 44px;          /* Accessibility baseline */
	min-width: 120px;          /* Prevent tiny buttons */
	padding: 0 20px;           /* Horizontal comfort */
	font-size: 14px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}