/**
 * kwtSMS — Login Page Styles
 *
 * Used on the OTP entry page (wp-login.php?action=kwtsms_otp) and the
 * passwordless login page (wp-login.php?action=kwtsms_passwordless).
 *
 * Inherits WordPress core login page colours and typography — no custom
 * brand overrides.  Only structural/layout rules live here.
 */

/* Base reset / body — no font or colour overrides; WP handles these */
body.login {
	background: #f0f0f1;
}

/* Login box */
#login {
	width: 360px;
	max-width: calc(100% - 40px);
	margin: 40px auto 0;
}

/* =========================================================================
   OTP box card
   ========================================================================= */

.kwtsms-otp-box {
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 1px 3px rgba(0,0,0,0.13);
	padding: 28px 32px;
	margin-top: 0;
}

.kwtsms-otp-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 10px;
	text-align: center;
}

.kwtsms-otp-desc {
	font-size: 14px;
	color: #666;
	text-align: center;
	margin: 0 0 20px;
	line-height: 1.5;
}

/* =========================================================================
   Error / success messages
   ========================================================================= */

.kwtsms-otp-error {
	background: #fef0f0;
	border-left: 4px solid #dc3232;
	color: #a0201e;
	padding: 10px 14px;
	border-radius: 0 3px 3px 0;
	margin-bottom: 16px;
	font-size: 14px;
	line-height: 1.4;
}

.kwtsms-otp-success {
	background: #edfbee;
	border-left: 4px solid #46b450;
	color: #2a7a2f;
	padding: 10px 14px;
	border-radius: 0 3px 3px 0;
	margin-bottom: 16px;
	font-size: 14px;
}

/* =========================================================================
   OTP code input
   ========================================================================= */

.kwtsms-code-group {
	margin-bottom: 16px;
}

.kwtsms-code-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	font-size: 28px;
	font-family: monospace;
	letter-spacing: 0.2em;
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 0;
	background: #fff;
	transition: border-color 0.15s;
}

.kwtsms-code-input:focus {
	border-color: #aaa !important;
	box-shadow: none !important;
	outline: none;
}

/* =========================================================================
   Submit button — structural only; colours come from WP button-primary
   ========================================================================= */

.kwtsms-btn {
	display: block !important;
	float: none !important;
	width: auto !important;
	margin: 0 auto 12px !important;
	padding: 6px 28px !important;
	cursor: pointer !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	height: auto !important;
}

/* =========================================================================
   Remove WordPress core login form border/padding — we style via .kwtsms-otp-box
   ========================================================================= */

#kwtsms-passwordless-form,
#kwtsms-otp-form {
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	background: transparent !important;
	margin: 0 0 8px !important;
}

/* =========================================================================
   Brand colours — kwtsms orange (#FFA200)
   Override WP default blue on our custom login pages only.
   ========================================================================= */

.login .kwtsms-btn.button-primary,
.login input[type="submit"].kwtsms-btn {
	background: #FFA200;
	border-color: #e09200 #c07e00 #c07e00;
	color: #fff;
	box-shadow: 0 1px 0 #c07e00;
	text-shadow: none;
}

.login .kwtsms-btn.button-primary:hover,
.login input[type="submit"].kwtsms-btn:hover {
	background: #e09200;
	border-color: #b06e00;
	color: #fff;
}

.login .kwtsms-btn.button-primary:focus,
.login input[type="submit"].kwtsms-btn:focus {
	border-color: #b06e00;
	box-shadow: 0 0 0 2px rgba(255,162,0,0.25);
	outline: none;
}

/* =========================================================================
   Resend button
   ========================================================================= */

.kwtsms-resend-wrap {
	text-align: center;
	margin-top: 18px;
}

.kwtsms-resend-btn {
	background: transparent;
	border: none;
	color: #FFA200;
	cursor: pointer;
	font-size: 14px;
	padding: 0;
	text-decoration: underline;
	transition: color 0.15s;
}

.kwtsms-resend-btn:hover:not(:disabled) {
	color: #c07e00;
}

.kwtsms-resend-btn:disabled {
	color: #aaa;
	cursor: default;
	text-decoration: none;
}

.kwtsms-resend-msg {
	display: block;
	font-size: 13px;
	color: #46b450;
	margin-top: 6px;
	min-height: 18px;
}

/* =========================================================================
   Back link
   ========================================================================= */

.kwtsms-back-link {
	text-align: left;
	margin-top: 16px;
	font-size: 13px;
}

.kwtsms-back-link a {
	color: #2271b1;
	text-decoration: none;
}

.kwtsms-back-link a:hover {
	text-decoration: underline;
}

/* =========================================================================
   Phone input (passwordless page)
   ========================================================================= */

#login .input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 11px 14px;
	font-size: 15px;
	border: 1px solid #ddd;
	border-radius: 0;
	background: #fff;
	margin-bottom: 14px;
	line-height: 1.4;
}

#login .input:focus {
	border-color: #FFA200;
	outline: none;
	box-shadow: 0 0 0 2px rgba(255,162,0,0.18);
}

/* =========================================================================
   Country dial code — unified input group + searchable dropdown
   ========================================================================= */

/* Phone group — dial button + number input share a single outer border */
.kwtsms-phone-group {
	display: flex;
	margin-bottom: 16px;
	border: 1px solid #ddd;
	border-radius: 0;
	overflow: visible;
	align-items: stretch;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.kwtsms-phone-group:focus-within {
	border-color: #FFA200;
	box-shadow: 0 0 0 2px rgba(255,162,0,0.18);
}

.kwtsms-dial-wrap {
	position: relative;
	flex: 0 0 auto;
}

.kwtsms-dial-trigger {
	height: 100%;
	min-width: 110px;
	width: 110px;
	padding: 0 10px;
	border: 0;
	border-right: 1px solid #e4e4e4;
	border-radius: 0;
	background: #f7f7f7;
	cursor: pointer;
	font-size: 14px;
	white-space: nowrap;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	box-sizing: border-box;
	line-height: 1;
	transition: background 0.12s;
}

.kwtsms-dial-trigger:hover {
	background: #f0f0f0;
}

.kwtsms-dial-trigger:focus {
	outline: none;
	background: #f0f0f0;
}

.kwtsms-dial-arrow {
	font-size: 10px;
	opacity: 0.5;
	margin-left: 1px;
}

.kwtsms-dial-dropdown {
	position: absolute;
	top: calc(100% + 2px);
	left: -1px;
	z-index: 9999;
	background: #fff;
	border: 1px solid #ddd;
	box-shadow: 0 6px 16px rgba(0,0,0,0.12);
	width: 272px;
	border-radius: 0 0 4px 4px;
}

.kwtsms-dial-search {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 9px 12px;
	border: 0;
	border-bottom: 1px solid #eee;
	font-size: 13px;
	outline: none;
	background: #fff;
}

.kwtsms-dial-dropdown ul {
	list-style: none;
	margin: 0;
	padding: 4px 0;
	max-height: 210px;
	overflow-y: auto;
}

.kwtsms-dial-dropdown li {
	padding: 8px 14px;
	cursor: pointer;
	font-size: 13px;
	line-height: 1.4;
}

.kwtsms-dial-dropdown li:hover,
.kwtsms-dial-dropdown li.is-focused {
	background: #fff6e6;
}

/* Number input inside the phone group: no individual border.
   Use #login prefix to beat the #login .input specificity (1,1,0 vs 1,2,0). */
#login .kwtsms-phone-group .input {
	flex: 1 1 0;
	min-width: 0;
	margin-bottom: 0;
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	padding: 11px 14px;
}

#login .kwtsms-phone-group .input:focus {
	border: 0 !important;
	box-shadow: none !important;
	outline: none !important;
}

/* =========================================================================
   RTL support
   ========================================================================= */

html[dir="rtl"] .kwtsms-otp-box,
html[lang^="ar"] .kwtsms-otp-box {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .kwtsms-otp-error,
html[lang^="ar"] .kwtsms-otp-error {
	border-left: none;
	border-right: 4px solid #dc3232;
}

html[dir="rtl"] .kwtsms-back-link,
html[lang^="ar"] .kwtsms-back-link {
	text-align: right;
}

html[dir="rtl"] .kwtsms-back-link a::before,
html[lang^="ar"] .kwtsms-back-link a::before {
	content: '→ ';
}

html[dir="rtl"] .kwtsms-back-link a .kwtsms-back-arrow,
html[lang^="ar"] .kwtsms-back-link a .kwtsms-back-arrow {
	display: none;
}
