/**
 * WP Hash Sender — Public Frontend Stylesheet
 *
 * Styles the form rendered by the [wp_hash_sender] shortcode.
 * Designed to be unobtrusive and integrate with most WordPress themes.
 *
 * @package WPHashSender
 * @since   1.0.0
 */

/* ===========================================================================
   CSS Custom Properties (Design Tokens)
   =========================================================================== */
.whs-form-wrap {
	--whs-pub-primary:     #4f46e5;
	--whs-pub-primary-dk:  #3730a3;
	--whs-pub-success:     #16a34a;
	--whs-pub-danger:      #dc2626;
	--whs-pub-border:      #d1d5db;
	--whs-pub-bg:          #ffffff;
	--whs-pub-text:        #1f2937;
	--whs-pub-muted:       #6b7280;
	--whs-pub-radius:      8px;
	--whs-pub-transition:  all .2s ease;
	max-width: 640px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: var(--whs-pub-text);
}

/* ===========================================================================
   Field Wrapper
   =========================================================================== */
.whs-field-wrap {
	margin-bottom: 20px;
}

/* ===========================================================================
   Labels
   =========================================================================== */
.whs-field-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--whs-pub-text);
	margin-bottom: 6px;
}

.whs-required {
	color: var(--whs-pub-danger);
	margin-left: 2px;
}

/* ===========================================================================
   Input, Textarea, Select
   =========================================================================== */
.whs-field-input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid var(--whs-pub-border);
	border-radius: var(--whs-pub-radius);
	font-size: 15px;
	font-family: inherit;
	color: var(--whs-pub-text);
	background: var(--whs-pub-bg);
	box-sizing: border-box;
	transition: var(--whs-pub-transition);
	outline: none;
}

.whs-field-input:focus {
	border-color: var(--whs-pub-primary);
	box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.whs-textarea-field {
	resize: vertical;
	min-height: 120px;
	line-height: 1.6;
}

.whs-select-field {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 40px;
	cursor: pointer;
}

/* ===========================================================================
   Radio / Checkbox Groups
   =========================================================================== */
.whs-choice-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--whs-pub-text);
	cursor: pointer;
	padding: 6px 0;
}

.whs-choice-label input[type="radio"],
.whs-choice-label input[type="checkbox"] {
	width: 17px;
	height: 17px;
	accent-color: var(--whs-pub-primary);
	cursor: pointer;
	flex-shrink: 0;
}

/* ===========================================================================
   File Input
   =========================================================================== */
.whs-file-field {
	padding: 8px;
	border-style: dashed;
	cursor: pointer;
}

.whs-file-field:hover {
	border-color: var(--whs-pub-primary);
	background: rgba(79,70,229,.03);
}

.whs-field-hint {
	font-size: 12px;
	color: var(--whs-pub-muted);
	margin-top: 5px;
}

/* ===========================================================================
   Submit Button
   =========================================================================== */
.whs-submit-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 28px;
	background: var(--whs-pub-primary);
	color: #fff;
	border: none;
	border-radius: var(--whs-pub-radius);
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: var(--whs-pub-transition);
	min-width: 160px;
}

.whs-submit-btn:hover {
	background: var(--whs-pub-primary-dk);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(79,70,229,.3);
}

.whs-submit-btn:disabled,
.whs-submit-btn.whs-submitting {
	background: #9ca3af;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Loading spinner on submit button. */
.whs-submit-btn.whs-submitting::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: whs-spin .7s linear infinite;
}

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

/* ===========================================================================
   Success / Error Messages
   =========================================================================== */
.whs-form-message {
	padding: 14px 18px;
	border-radius: var(--whs-pub-radius);
	font-size: 14px;
	line-height: 1.6;
	margin-bottom: 20px;
}

.whs-msg-success {
	background: #dcfce7;
	color: var(--whs-pub-success);
	border: 1px solid #bbf7d0;
}

.whs-msg-error {
	background: #fee2e2;
	color: var(--whs-pub-danger);
	border: 1px solid #fecaca;
}

.whs-error {
	color: var(--whs-pub-danger);
	font-size: 14px;
	padding: 10px;
	background: #fee2e2;
	border-radius: 6px;
	border: 1px solid #fecaca;
}

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 480px) {
	.whs-submit-btn {
		width: 100%;
	}
}
