/* =========================================================
   Auth + Bookings styles — uses the same CSS vars as app-home.css
   ========================================================= */

:root {
	--ss-bg: #121212;
	--ss-bg-elevated: #1e1e1e;
	--ss-bg-card: #2a2a2a;
	--ss-text: #ffffff;
	--ss-text-muted: rgba(255, 255, 255, 0.72);
	--ss-red: #e53935;
	--ss-red-dark: #c62828;
	--ss-border: rgba(255, 255, 255, 0.08);
	--ss-radius-sm: 12px;
	--ss-radius-md: 18px;
	--ss-radius-lg: 22px;
	--ss-radius-pill: 999px;
	--ss-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* ── Login page ──────────────────────────────────────────── */

.ss-login-page {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background: var(--ss-bg);
	color: var(--ss-text);
	font-family: "Cairo", "Segoe UI", Tahoma, sans-serif;
	-webkit-font-smoothing: antialiased;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ss-login-wrap {
	width: 100%;
	max-width: 480px;
	padding: 48px 20px 40px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
}

.ss-login-logo {
	display: inline-flex;
	line-height: 0;
	margin-bottom: 4px;
}

.ss-login-intro {
	text-align: center;
}

.ss-login-intro__title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	color: var(--ss-text);
}

.ss-login-intro__subtitle {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--ss-text-muted);
}

.ss-login-card {
	width: 100%;
	background: var(--ss-bg-elevated);
	border-radius: var(--ss-radius-lg);
	padding: 28px 22px 22px;
	box-shadow: var(--ss-shadow);
}

.ss-login-card__heading {
	margin: 0 0 20px;
	font-size: 18px;
	font-weight: 800;
	text-align: right;
	color: var(--ss-text);
}

.ss-login-error {
	background: rgba(229, 57, 53, 0.12);
	border: 1px solid rgba(229, 57, 53, 0.3);
	color: #ff6b6b;
	border-radius: var(--ss-radius-sm);
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 600;
	text-align: right;
	margin-bottom: 16px;
	line-height: 1.5;
}

.ss-login-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ss-login-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ss-login-field__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ss-text-muted);
	text-align: right;
}

.ss-login-field__wrap {
	position: relative;
}

.ss-login-field__input {
	width: 100%;
	height: 52px;
	border: 1px solid var(--ss-border);
	border-radius: var(--ss-radius-pill);
	background: var(--ss-bg-card);
	color: var(--ss-text);
	padding: 0 48px 0 18px;
	font: inherit;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ss-login-field__input::placeholder {
	color: rgba(255, 255, 255, 0.3);
}

.ss-login-field__input:focus {
	border-color: rgba(229, 57, 53, 0.5);
	box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.15);
}

.ss-login-field__icon {
	position: absolute;
	top: 50%;
	right: 16px;
	transform: translateY(-50%);
	color: var(--ss-text-muted);
	pointer-events: none;
	display: flex;
	line-height: 0;
}

.ss-login-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 52px;
	border-radius: var(--ss-radius-pill);
	font: inherit;
	font-size: 16px;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

.ss-login-btn:active {
	transform: scale(0.97);
}

.ss-login-btn--primary {
	background: var(--ss-red);
	color: #fff;
	box-shadow: 0 8px 24px rgba(229, 57, 53, 0.35);
}

.ss-login-btn--primary:hover {
	background: var(--ss-red-dark);
}

.ss-login-btn--ghost {
	background: var(--ss-bg-card);
	color: var(--ss-text);
}

/* ── Phone display bar (step 2) ──────────────────────────── */

.ss-login-phone-display {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--ss-bg-card);
	border-radius: var(--ss-radius-pill);
	padding: 10px 18px;
	margin-bottom: 4px;
}

.ss-login-phone-display__number {
	font-size: 15px;
	font-weight: 700;
	color: var(--ss-text);
	direction: ltr;
}

.ss-login-phone-display__change {
	background: none;
	border: none;
	color: var(--ss-red);
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	padding: 0;
}

.ss-login-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--ss-text-muted);
	font-size: 13px;
	font-weight: 600;
}

.ss-login-divider::before,
.ss-login-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: var(--ss-border);
}

/* ── Bookings page ───────────────────────────────────────── */

.ss-bookings {
	padding-top: 8px;
}

.ss-bookings-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ss-booking-card {
	border-radius: var(--ss-radius-lg);
	overflow: hidden;
	background: var(--ss-bg-elevated);
	box-shadow: var(--ss-shadow);
}

.ss-booking-card__image {
	position: relative;
	height: 160px;
	background-size: cover;
	background-position: center;
}

.ss-booking-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ss-booking-card__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.ss-booking-card__title {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
	flex: 1;
	text-align: right;
}

.ss-booking-card__order-number {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--ss-text-muted);
	text-align: right;
}

.ss-booking-card__price {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: var(--ss-red);
	text-align: right;
}

.ss-booking-card__date {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ss-text-muted);
	flex-direction: row-reverse;
	justify-content: flex-end;
}

/* Status badges */
.ss-booking-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: var(--ss-radius-pill);
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	flex-shrink: 0;
}

.ss-booking-badge--pending {
	background: rgba(255, 193, 7, 0.15);
	color: #ffc107;
}

.ss-booking-badge--processing {
	background: rgba(33, 150, 243, 0.15);
	color: #42a5f5;
}

.ss-booking-badge--on-hold {
	background: rgba(255, 152, 0, 0.15);
	color: #ffa726;
}

.ss-booking-badge--completed {
	background: rgba(37, 211, 102, 0.15);
	color: #25d366;
}

.ss-booking-badge--cancelled {
	background: rgba(229, 57, 53, 0.15);
	color: var(--ss-red);
}

.ss-booking-badge--refunded {
	background: rgba(156, 39, 176, 0.15);
	color: #ce93d8;
}

.ss-booking-badge--failed {
	background: rgba(229, 57, 53, 0.15);
	color: var(--ss-red);
}

/* Empty state */
.ss-bookings-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 48px 24px 32px;
	gap: 14px;
}

.ss-bookings-empty__icon {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: var(--ss-bg-elevated);
	border: 1px solid var(--ss-border);
	display: grid;
	place-items: center;
	color: var(--ss-text-muted);
}

.ss-bookings-empty__title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
}

.ss-bookings-empty__desc {
	margin: 0;
	font-size: 14px;
	color: var(--ss-text-muted);
	line-height: 1.6;
}

/* ── Toast notification ──────────────────────────────────── */

.ss-toast {
	position: fixed;
	bottom: calc(80px + env(safe-area-inset-bottom));
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	max-width: calc(var(--ss-max-width, 480px) - 32px);
	width: calc(100% - 32px);
	background: #1e2a1e;
	border: 1px solid rgba(37, 211, 102, 0.3);
	color: #25d366;
	padding: 14px 20px;
	border-radius: var(--ss-radius-md);
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	z-index: 200;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.ss-toast--error {
	background: rgba(229, 57, 53, 0.15);
	border-color: rgba(229, 57, 53, 0.35);
	color: #ff6b6b;
}

.ss-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ── Auth modal ──────────────────────────────────────────── */

.ss-auth-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 300;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ss-auth-modal:not([hidden]) {
	display: flex;
}

.ss-auth-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	cursor: pointer;
}

.ss-auth-modal__panel {
	position: relative;
	width: 100%;
	max-width: 340px;
	background: var(--ss-bg-elevated);
	border-radius: var(--ss-radius-lg);
	padding: 32px 24px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	box-shadow: var(--ss-shadow);
}

.ss-auth-modal__close {
	position: absolute;
	top: 14px;
	left: 14px;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: var(--ss-bg-card);
	color: var(--ss-text-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	line-height: 0;
}

.ss-auth-modal__icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(229, 57, 53, 0.1);
	color: var(--ss-red);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 4px;
}

.ss-auth-modal__title {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: var(--ss-text);
	text-align: center;
}

.ss-auth-modal__desc {
	margin: 0;
	font-size: 14px;
	color: var(--ss-text-muted);
	text-align: center;
	line-height: 1.6;
}

.ss-auth-modal__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin-top: 8px;
}

/* ── Account page ────────────────────────────────────────── */

.ss-account {
	padding: 8px 0 0;
}

.ss-account-card {
	background: var(--ss-bg-elevated);
	border-radius: var(--ss-radius-lg);
	padding: 28px 20px 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	box-shadow: var(--ss-shadow);
	margin-bottom: 20px;
}

.ss-account-avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: var(--ss-bg-card);
	border: 2px solid rgba(229, 57, 53, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	font-weight: 800;
	color: var(--ss-red);
	margin-bottom: 8px;
}

.ss-account-name {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: var(--ss-text);
}

.ss-account-email {
	margin: 0;
	font-size: 14px;
	color: var(--ss-text-muted);
}

.ss-account-points {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--ss-bg-card);
	border-radius: var(--ss-radius-pill);
	padding: 5px 14px;
	font-size: 13px;
	font-weight: 700;
	color: var(--ss-text-muted);
	margin-top: 6px;
}

.ss-account-points svg {
	color: var(--ss-red);
}

.ss-account-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	margin-top: 16px;
}

.ss-account-section-title {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 800;
	color: var(--ss-text);
	text-align: right;
}

.ss-account-info-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--ss-bg-elevated);
	border-radius: var(--ss-radius-md);
	margin-bottom: 10px;
}

.ss-account-info-row__label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ss-text-muted);
}

.ss-account-info-row__value {
	font-size: 14px;
	font-weight: 700;
	color: var(--ss-text);
	direction: ltr;
}

/* ── OTP input ───────────────────────────────────────────── */

.ss-otp-input {
	text-align: center;
	font-size: 26px;
	font-weight: 800;
	letter-spacing: 10px;
	padding-inline-start: 18px;
	padding-inline-end: 48px;
	/* Prevent iOS from auto-suggesting */
	-webkit-text-security: none;
}

.ss-otp-input::placeholder {
	letter-spacing: 4px;
	font-size: 18px;
	opacity: 0.3;
}

/* ── Inline message (replaces URL-param error approach) ──── */

.ss-login-message {
	border-radius: var(--ss-radius-sm);
	padding: 12px 14px;
	font-size: 14px;
	font-weight: 600;
	text-align: right;
	line-height: 1.5;
	margin-bottom: 4px;
}

.ss-login-message--error {
	background: rgba(229, 57, 53, 0.12);
	border: 1px solid rgba(229, 57, 53, 0.3);
	color: #ff6b6b;
}

.ss-login-message--success {
	background: rgba(37, 211, 102, 0.08);
	border: 1px solid rgba(37, 211, 102, 0.25);
	color: #25d366;
}

/* ── Countdown timer ─────────────────────────────────────── */

.ss-otp-countdown {
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: var(--ss-text-muted);
	min-height: 20px;
	margin: 0;
}

/* ── Loading state ───────────────────────────────────────── */

.ss-login-btn.is-loading {
	opacity: 0.65;
	pointer-events: none;
}

/* ── Resend button (disabled while countdown runs) ───────── */

.ss-login-btn--resend:disabled {
	opacity: 0.4;
	cursor: not-allowed;
	pointer-events: none;
}

/* ── Spin animation for potential future use ─────────────── */

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

/* ── Light mode overrides ────────────────────────────────── */

.ss-app--light .ss-login-card,
.ss-app--light .ss-booking-card {
	background: #ffffff;
}

.ss-app--light .ss-login-field__input,
.ss-app--light .ss-login-btn--ghost {
	background: #f0f0f0;
	color: #111;
}

.ss-app--light .ss-login-page {
	background: #f5f5f5;
	color: #111;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (min-width: 481px) {
	.ss-login-card {
		box-shadow: 0 0 0 1px var(--ss-border), var(--ss-shadow);
	}
}
