@import '../tokens.scss';

/* Buttons */
.rtgw-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--rtgw-font);
	font-weight: 600;
	border-radius: var(--rtgw-radius-sm);
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
	line-height: 1;
}
.rtgw-btn:active { transform: translateY(1px); }
.rtgw-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.rtgw-btn--md { padding: 10px 18px; font-size: 13px; }
.rtgw-btn--sm { padding: 6px 12px; font-size: 12px; }

.rtgw-btn--primary {
	background: var(--rtgw-accent-gradient);
	color: #fff;
	box-shadow: 0 6px 16px rgba(109, 74, 255, 0.35);
}
.rtgw-btn--primary:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(109, 74, 255, 0.45); }

.rtgw-btn--secondary {
	background: var(--rtgw-surface);
	color: var(--rtgw-ink);
	border-color: var(--rtgw-line);
}
.rtgw-btn--secondary:hover:not(:disabled) { border-color: var(--rtgw-accent); color: var(--rtgw-accent-dark); }

.rtgw-btn--ghost {
	background: transparent;
	color: var(--rtgw-ink-soft);
}
.rtgw-btn--ghost:hover:not(:disabled) { color: var(--rtgw-danger); }

.rtgw-btn.is-busy { opacity: 0.7; cursor: progress; }

/* Card */
.rtgw-card {
	background: var(--rtgw-surface);
	border-radius: var(--rtgw-radius);
	box-shadow: var(--rtgw-shadow);
	border: 1px solid var(--rtgw-line);
	overflow: hidden;
}
.rtgw-card__header {
	padding: 18px 22px;
	border-bottom: 1px solid var(--rtgw-line);
	background: var(--rtgw-surface-soft);
}
.rtgw-card__body { padding: 22px; }
.rtgw-card__footer {
	padding: 16px 22px;
	display: flex;
	align-items: center;
	gap: 12px;
}

/* Toggle switch */
.rtgw-toggle-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	cursor: pointer;
	margin-bottom: 16px;
}
.rtgw-toggle {
	flex: 0 0 auto;
	width: 40px;
	height: 22px;
	border-radius: 999px;
	background: #d8d5ec;
	position: relative;
	transition: background 0.15s ease;
	margin-top: 2px;
}
.rtgw-toggle.is-on { background: var(--rtgw-accent-gradient); }
.rtgw-toggle__thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
	transition: transform 0.15s ease;
}
.rtgw-toggle.is-on .rtgw-toggle__thumb { transform: translateX(18px); }
.rtgw-toggle-row__text { display: flex; flex-direction: column; }
.rtgw-toggle-row__label { font-weight: 600; color: var(--rtgw-ink); font-size: 13.5px; }
.rtgw-toggle-row__help { font-size: 12px; color: var(--rtgw-ink-soft); margin-top: 2px; }

/* Fields */
.rtgw-field-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}
.rtgw-field-row__label { font-weight: 600; font-size: 13px; color: var(--rtgw-ink); }
.rtgw-field-row__help { font-size: 12px; color: var(--rtgw-ink-soft); }
.rtgw-input {
	font-family: var(--rtgw-font);
	font-size: 13.5px;
	padding: 10px 12px;
	border-radius: var(--rtgw-radius-sm);
	border: 1px solid var(--rtgw-line);
	background: var(--rtgw-surface);
	color: var(--rtgw-ink);
	transition: border-color 0.12s ease, box-shadow 0.12s ease;
	width: 100%;
	box-sizing: border-box;
}
.rtgw-input:focus {
	outline: none;
	border-color: var(--rtgw-accent);
	box-shadow: 0 0 0 3px var(--rtgw-accent-soft);
}
.rtgw-input--textarea { resize: vertical; min-height: 70px; }

/* Notice */
.rtgw-notice {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	border-radius: var(--rtgw-radius-sm);
	font-size: 13px;
	margin: 16px 0;
	border: 1px solid transparent;
}
.rtgw-notice--success { background: #eafbf2; color: var(--rtgw-success); border-color: #bdecd4; }
.rtgw-notice--error { background: #fdecef; color: var(--rtgw-danger); border-color: #f6c3cd; }
.rtgw-notice--info { background: var(--rtgw-accent-soft); color: var(--rtgw-accent-dark); border-color: #d9ccff; }
.rtgw-notice__dismiss {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	color: inherit;
	opacity: 0.6;
	line-height: 1;
}
.rtgw-notice__dismiss:hover { opacity: 1; }

/* Spinner */
.rtgw-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--rtgw-accent-soft);
	border-top-color: var(--rtgw-accent);
	animation: rtgw-spin 0.7s linear infinite;
}
@keyframes rtgw-spin {
	to { transform: rotate(360deg); }
}

/* Media picker */
.rtgw-media-picker {
	display: flex;
	align-items: center;
	gap: 14px;
}
.rtgw-media-picker__preview {
	width: 64px;
	height: 64px;
	border-radius: var(--rtgw-radius-sm);
	border: 1.5px dashed var(--rtgw-line);
	background: var(--rtgw-surface-soft);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	cursor: pointer;
	flex: 0 0 auto;
	transition: border-color 0.12s ease;
}
.rtgw-media-picker__preview:hover { border-color: var(--rtgw-accent); }
.rtgw-media-picker__preview img { width: 100%; height: 100%; object-fit: cover; }
.rtgw-media-picker__placeholder { color: #b7b3d6; }
.rtgw-media-picker__actions { display: flex; flex-direction: column; gap: 4px; }
.rtgw-media-picker__link {
	background: none;
	border: none;
	padding: 0;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--rtgw-accent-dark);
	cursor: pointer;
	text-align: left;
}
.rtgw-media-picker__link:hover { text-decoration: underline; }
.rtgw-media-picker__link--danger { color: var(--rtgw-danger); }
