/**
 * Awesome Support front-end styling
 *
 * Brings the Submit Ticket / My Tickets / Ticket Details pages in line with
 * the site's Astra Customizer colours (via Astra's global colour CSS vars)
 * and the general Mindful Marketing look and feel.
 *
 * Loaded only on Awesome Support front-end pages, see functions.php.
 */

/* Overall page width/spacing */
#wpas-submit,
.wpas-ticket-details,
.wpas-tickets-list-wrapper {
	max-width: 800px;
	margin: 0 auto;
	padding: 20px 0 40px;
}

/* Without this, the padding on inputs/selects below adds to their total
   height instead of being absorbed into it. */
#wpas-submit *,
.wpas-form-group * {
	box-sizing: border-box;
}

/* Awesome Support's own stylesheet fixes every input/select to 34px tall
   (.wpas-form-control), which is too short to fit our 16px font plus 20px
   of vertical padding - that's what was actually clipping the dropdown
   text, not box-sizing. Letting height follow the content fixes it. */
.wpas-form-control {
	height: auto !important;
}

/*
 * Field order on the Submit Ticket form. All these field wrappers are
 * direct children of the same container
 * (.wpas-submission-form-inside-after-subject), verified against the
 * site's real markup - so plain flex + order reorders them without
 * needing to move anything in the DOM via JavaScript.
 *
 * Order: Type of Request -> Your Name -> Your Company Name -> Subject ->
 * Description -> Priority -> Page URL -> Screenshots
 */
.wpas-submission-form-inside-after-subject {
	display: flex;
	flex-direction: column;
}

#wpas_request_type_wrapper    { order: 1; }
#wpas_customer_name_wrapper   { order: 2; }
#wpas_company_name_wrapper    { order: 3; }
#wpas_title_wrapper           { order: 4; }
#wpas_message_wrapper         { order: 5; }
#wpas_ticket_priority_wrapper { order: 6; }
#wpas_page_url_wrapper        { order: 7; }
#wpas_screenshots_wrapper     { order: 8; }

/* General Attachments isn't needed for either request type - Screenshots
   covers Troubleshooting, and the Wording/Image Changes repeater has its
   own upload for Website Update. */
#wpas_files_wrapper {
	display: none !important;
}

/* Labels */
.wpas-form-group label,
#wpas-submit label {
	font-weight: 600;
	margin-bottom: 6px;
	display: inline-block;
}

/* Text inputs, textareas, selects */
.wpas-form-group input[type="text"],
.wpas-form-group input[type="email"],
.wpas-form-group textarea,
.wpas-form-group select,
#wpas-submit input[type="text"],
#wpas-submit input[type="email"],
#wpas-submit textarea,
#wpas-submit select {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #d7d7d7;
	border-radius: 4px;
	font-family: inherit;
	font-size: 16px;
	transition: border-color 0.15s ease-in-out;
}

.wpas-form-group input:focus,
.wpas-form-group textarea:focus,
.wpas-form-group select:focus {
	border-color: var( --ast-global-color-0, #0274be );
	outline: none;
}

/* Buttons (submit ticket / reply / attach) */
#wpas-submit button[type="submit"],
#wpas-submit .btn,
.wpas-form-group .btn,
a.wpas-btn,
button.wpas-btn {
	background-color: var( --ast-global-color-0, #0274be );
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 12px 28px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}

#wpas-submit button[type="submit"]:hover,
#wpas-submit .btn:hover,
.wpas-form-group .btn:hover {
	background-color: var( --ast-global-color-1, #015a8e );
}

/* My Tickets list table */
.wpas-table,
table.widefat.wpas-tickets-list {
	width: 100%;
	border-collapse: collapse;
	margin: 20px 0;
}

.wpas-table th,
.wpas-table td,
table.widefat.wpas-tickets-list th,
table.widefat.wpas-tickets-list td {
	padding: 12px;
	border-bottom: 1px solid #eaeaea;
	text-align: left;
}

/* Priority / status badges */
.wpas-label,
.wpas-status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
}

/* Registration/login form notices (e.g. weak-password message) */
.mm-form-notice {
	background: #fbe7e9;
	border: 1px solid #e2a3a9;
	color: #8a2c33;
	border-radius: 4px;
	padding: 10px 14px;
	margin: 0 0 16px;
	font-size: 14px;
}

/* Wording / Image Changes repeater, injected by wording-changes.js */
.mm-wording-changes {
	margin: 24px 0;
	padding: 16px 20px;
	border: 1px solid #e7dbe1;
	border-radius: 8px;
	background: #fbf8fa;
}

.mm-wording-changes h3 {
	margin-top: 0;
}

.mm-wording-changes__checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.mm-wording-changes__hint {
	color: #6b6b6b;
	font-size: 13px;
	margin: 6px 0 16px;
}

.mm-wording-changes__row {
	background: #fff;
	border: 1px solid #e7dbe1;
	border-radius: 6px;
	padding: 14px 16px;
	margin-bottom: 12px;
}

.mm-wording-changes__row label {
	display: block;
	font-weight: 600;
	margin: 10px 0 4px;
}

.mm-wording-changes__row select,
.mm-wording-changes__row input[type="text"],
.mm-wording-changes__row textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 12px;
	border: 1px solid #d7d7d7;
	border-radius: 4px;
	font-family: inherit;
	font-size: 15px;
}

.mm-wording-changes__remove {
	margin-top: 10px;
	color: #b3323f;
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

.mm-wording-changes__add {
	margin-top: 4px;
}

/* Formatted summary shown on the ticket itself, see functions.php */
.mm-wording-changes-summary {
	background: #fbf8fa;
	border: 1px solid #e7dbe1;
	border-radius: 6px;
	padding: 12px 16px;
	font-family: inherit;
	font-size: 14px;
}

.mm-wording-changes-summary p:last-child {
	margin-bottom: 0;
}

/* Hint text injected below the Description label, see wording-changes.js */
.wpas-form-hint {
	color: #6b6b6b;
	font-size: 13px;
	margin: -4px 0 8px;
}

/* The logged-out Login/Register box on the ticket page is two separate
   forms (#wpas_form_login, #wpas_form_registration) that sit side-by-side
   on desktop but stack vertically on mobile with no gap between the Log
   In button and the Register heading below it. */
#wpas_form_registration {
	margin-top: 24px;
}

@media (max-width: 768px) {
	#wpas_form_registration {
		margin-top: 48px;
	}
}
