/**
 * SN Blog Core — Frontend form styles.
 *
 * Submission form, login, register, shared form components.
 *
 * @package SN_Blog_Core
 * @since   1.0.0
 */

/* ============================================
   Form Layout
   ============================================ */

.sn-form-wrap {
	max-width: 560px;
	margin: 0 auto;
}

.sn-submission-form-wrap {
	max-width: 800px;
	margin: 0 auto;
}

.sn-form {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.sn-form-group {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.sn-form-group label {
	font-weight: 600;
	font-size: 0.875rem;
}

.sn-form-group .required {
	color: var(--wp--preset--color--error, #f44336);
}

/* ============================================
   Inputs
   ============================================ */

.sn-form input[type="text"],
.sn-form input[type="email"],
.sn-form input[type="password"],
.sn-form textarea,
.sn-form select {
	width: 90%;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
	background: var(--wp--preset--color--bg-tertiary, #24242e);
	color: var(--wp--preset--color--text-primary, #f5f5f5);
	border: 1px solid var(--wp--preset--color--border, #2a2a36);
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.5;
	transition: border-color 0.2s;
}

.sn-form input:focus,
.sn-form textarea:focus,
.sn-form select:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary, #e53935);
	box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.2);
}

.sn-form textarea {
	resize: vertical;
	min-height: 100px;
}

.sn-form small {
	color: var(--wp--preset--color--text-muted, #8a8a96);
	font-size: 0.8rem;
}

/* ============================================
   Buttons
   ============================================ */

.sn-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.6rem 1.2rem;
	border: none;
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s, opacity 0.2s;
	line-height: 1.4;
}

.sn-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.sn-btn-primary {
	background: var(--wp--preset--color--primary, #e53935);
	color: #fff;
}

.sn-btn-primary:hover {
	background: var(--wp--preset--color--primary-hover, #ff5252);
}

.sn-btn-secondary {
	background: var(--wp--preset--color--bg-tertiary, #24242e);
	color: var(--wp--preset--color--text-primary, #f5f5f5);
	border: 1px solid var(--wp--preset--color--border, #2a2a36);
}

.sn-btn-secondary:hover {
	background: var(--wp--preset--color--bg-elevated, #2a2a36);
}

.sn-btn-success {
	background: var(--wp--preset--color--success, #4caf50);
	color: #fff;
}

.sn-btn-warning {
	background: var(--wp--preset--color--warning, #ff9800);
	color: #fff;
}

.sn-btn-danger {
	background: var(--wp--preset--color--error, #f44336);
	color: #fff;
}

.sn-btn-full {
	width: 100%;
}

/* ============================================
   Form Actions
   ============================================ */

.sn-form-actions {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.sn-form-row {
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
}

.sn-form-note {
	text-align: center;
	color: var(--wp--preset--color--text-muted, #8a8a96);
	font-size: 0.85rem;
}

.sn-form-note a {
	color: var(--wp--preset--color--primary, #e53935);
}

/* ============================================
   Character Count
   ============================================ */

.sn-char-count {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
	text-align: right;
}

/* ============================================
   Image Upload Zone
   ============================================ */

.sn-image-upload-zone {
	position: relative;
	border: 2px dashed var(--wp--preset--color--border, #2a2a36);
	border-radius: 8px;
	padding: 1.5rem;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
	min-height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.sn-image-upload-zone:hover,
.sn-image-upload-zone.dragover {
	border-color: var(--wp--preset--color--primary, #e53935);
	background: rgba(229, 57, 53, 0.05);
}

.sn-image-upload-zone .sn-file-input {
	display: none;
}

.sn-upload-label {
	color: var(--wp--preset--color--text-muted, #8a8a96);
	font-size: 0.9rem;
}

.sn-featured-preview {
	max-width: 100%;
	max-height: 200px;
	border-radius: 4px;
}

.sn-remove-image {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--wp--preset--color--error, #f44336);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}

/* ============================================
   Notices
   ============================================ */

.sn-notice {
	padding: 0.75rem 1rem;
	border-radius: 6px;
	border-left: 4px solid;
	margin-bottom: 1rem;
	font-size: 0.9rem;
}

.sn-notice-error {
	background: rgba(244, 67, 54, 0.1);
	border-color: var(--wp--preset--color--error, #f44336);
	color: var(--wp--preset--color--error, #f44336);
}

.sn-notice-success {
	background: rgba(76, 175, 80, 0.1);
	border-color: var(--wp--preset--color--success, #4caf50);
	color: var(--wp--preset--color--success, #4caf50);
}

.sn-notice-warning {
	background: rgba(255, 152, 0, 0.1);
	border-color: var(--wp--preset--color--warning, #ff9800);
	color: var(--wp--preset--color--warning, #ff9800);
}

.sn-notice-info {
	background: rgba(33, 150, 243, 0.1);
	border-color: var(--wp--preset--color--info, #2196f3);
	color: var(--wp--preset--color--info, #2196f3);
}

.sn-notice a {
	color: inherit;
	font-weight: 600;
}

/* ============================================
   Checkbox
   ============================================ */

.sn-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
	font-weight: 400;
	font-size: 0.875rem;
	cursor: pointer;
}

.sn-checkbox-label input[type="checkbox"] {
	margin-top: 0.2rem;
	flex-shrink: 0;
}

/* ============================================
   Honeypot (hidden from users)
   ============================================ */

.sn-hp {
	position: absolute;
	left: -9999px;
	opacity: 0;
	height: 0;
	overflow: hidden;
}

/* ============================================
   Forgot Password Link
   ============================================ */

.sn-forgot-link {
	font-size: 0.85rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
}

.sn-forgot-link:hover {
	color: var(--wp--preset--color--primary, #e53935);
}

/* ============================================
   Profile Edit Form
   ============================================ */

.sn-profile-wrap {
	max-width: 600px;
	margin: 0 auto;
}

.sn-profile-links {
	display: flex;
	gap: 0.75rem;
	margin-bottom: 1.5rem;
}

.sn-profile-stats {
	display: flex;
	gap: 1.5rem;
	padding: 1.25rem;
	background: var(--wp--preset--color--bg-secondary, #1a1a24);
	border-radius: 8px;
	margin-bottom: 1.5rem;
}

.sn-stat-item {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.sn-stat-value {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--wp--preset--color--text-primary, #f5f5f5);
}

.sn-stat-label {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
}

.sn-trust-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 0.8rem;
	font-weight: 600;
}

.sn-trust-0 { background: rgba(224,224,224,0.15); color: #bbb; }
.sn-trust-1 { background: rgba(76,175,80,0.15); color: #66bb6a; }
.sn-trust-2 { background: rgba(33,150,243,0.15); color: #42a5f5; }
.sn-trust-3 { background: rgba(255,152,0,0.15); color: #ffa726; }
.sn-trust-4 { background: rgba(156,39,176,0.15); color: #ab47bc; }

.sn-avatar-field {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.sn-avatar-preview {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--wp--preset--color--bg-tertiary, #24242e);
	display: flex;
	align-items: center;
	justify-content: center;
}

.sn-avatar-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sn-avatar-placeholder {
	font-size: 2.5rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
}

.sn-avatar-actions {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.sn-color-field {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.sn-color-field input[type="color"] {
	width: 48px;
	height: 48px;
	padding: 2px;
	border: 2px solid var(--wp--preset--color--border, #2a2a36);
	border-radius: 8px;
	background: none;
	cursor: pointer;
}

.sn-color-hint {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
}

.sn-social-fieldset {
	border: 1px solid var(--wp--preset--color--border, #2a2a36);
	border-radius: 8px;
	padding: 1.25rem;
}

.sn-social-fieldset legend {
	font-weight: 600;
	font-size: 0.875rem;
	padding: 0 0.5rem;
}

/* ============================================
   Input type URL
   ============================================ */

.sn-form input[type="url"] {
	width: 90%;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
	background: var(--wp--preset--color--bg-tertiary, #24242e);
	color: var(--wp--preset--color--text-primary, #f5f5f5);
	border: 1px solid var(--wp--preset--color--border, #2a2a36);
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.95rem;
	line-height: 1.5;
	transition: border-color 0.2s;
}

.sn-form input[type="url"]:focus {
	outline: none;
	border-color: var(--wp--preset--color--primary, #e53935);
	box-shadow: 0 0 0 2px rgba(229, 57, 53, 0.2);
}

/* ============================================
   Account Dashboard — Modern Card Layout
   ============================================ */

.sn-account {
	max-width: 720px;
	margin: 0 auto;
}

.sn-account__card {
	background: var(--wp--preset--color--bg-secondary, #1a1a24);
	border: 2px solid var(--author-color, var(--wp--preset--color--primary, #e53935));
	border-radius: 16px;
	overflow: hidden;
	margin-bottom: 1.5rem;
}

.sn-account__header {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	padding: 1.75rem 2rem;
	background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, transparent 100%);
	border-bottom: 1px solid var(--wp--preset--color--border, #2a2a36);
}

.sn-account__avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	border: 3px solid var(--author-color, var(--wp--preset--color--primary, #e53935));
}

.sn-account__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sn-account__details {
	min-width: 0;
}

.sn-account__name {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 0.15rem;
	color: var(--wp--preset--color--text-primary, #f5f5f5);
}

.sn-account__email {
	font-size: 0.85rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
	margin: 0 0 0.5rem;
}

.sn-account__badges {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.sn-account__stat {
	font-size: 0.8rem;
	color: var(--wp--preset--color--text-muted, #8a8a96);
}

/* Tab Navigation */
.sn-account__nav {
	display: flex;
	gap: 0;
	overflow-x: auto;
}

.sn-account__tab {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.85rem 1.25rem;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--wp--preset--color--text-muted, #8a8a96);
	text-decoration: none;
	border-bottom: 3px solid transparent;
	transition: color 0.2s, border-color 0.2s, background-color 0.2s;
	white-space: nowrap;
}

.sn-account__tab:hover {
	color: var(--wp--preset--color--text-primary, #f5f5f5);
	background: rgba(255,255,255,0.03);
}

.sn-account__tab--active {
	color: var(--author-color, var(--wp--preset--color--primary, #e53935));
	border-bottom-color: var(--author-color, var(--wp--preset--color--primary, #e53935));
	font-weight: 600;
}

.sn-account__tab--cta {
	color: var(--author-color, var(--wp--preset--color--primary, #e53935));
	margin-left: auto;
}

.sn-account__tab svg {
	flex-shrink: 0;
	opacity: 0.7;
}

.sn-account__tab--active svg,
.sn-account__tab--cta svg {
	opacity: 1;
}

/* Tab content area */
.sn-account__content {
	background: var(--wp--preset--color--bg-secondary, #1a1a24);
	border: 1px solid var(--wp--preset--color--border, #2a2a36);
	border-radius: 12px;
	padding: 2rem;
}

/* Form sections */
.sn-form-section {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--wp--preset--color--border, #2a2a36);
}

.sn-form-section:last-of-type {
	border-bottom: none;
	padding-bottom: 0;
}

.sn-form-section__title {
	font-size: 1rem;
	font-weight: 600;
	color: var(--wp--preset--color--text-primary, #f5f5f5);
	margin: 0;
}

/* Two-column row */
.sn-form-row-2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
}

/* Avatar field - horizontal layout */
.sn-avatar-field {
	display: flex;
	align-items: center;
	gap: 1.25rem;
}

.sn-avatar-controls {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	align-items: flex-start;
}

.sn-avatar-controls .sn-btn {
	width: auto;
}

.sn-avatar-buttons {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

/* Social links grid */
.sn-social-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.25rem;
}

.sn-social-grid .sn-form-group:last-child:nth-child(odd) {
	grid-column: 1 / -1;
	max-width: calc(50% - 0.5rem);
}

/* Small button variant */
.sn-btn-sm {
	padding: 0.4rem 0.8rem;
	font-size: 0.8rem;
}

/* Ghost button */
.sn-btn-ghost {
	background: transparent;
	color: var(--wp--preset--color--text-muted, #8a8a96);
	border: 1px solid var(--wp--preset--color--border, #2a2a36);
}

.sn-btn-ghost:hover {
	color: var(--wp--preset--color--error, #f44336);
	border-color: var(--wp--preset--color--error, #f44336);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 600px) {
	.sn-form-actions {
		flex-direction: column;
	}

	.sn-form-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	.sn-account__header {
		flex-direction: column;
		text-align: center;
		padding: 1.25rem;
	}

	.sn-account__badges {
		justify-content: center;
	}

	.sn-account__nav {
		justify-content: stretch;
	}

	.sn-account__tab {
		flex: 1;
		justify-content: center;
		padding: 0.7rem 0.5rem;
		font-size: 0.75rem;
	}

	.sn-account__tab--cta {
		margin-left: 0;
	}

	.sn-account__content {
		padding: 1.25rem;
	}

	.sn-form-row-2 {
		grid-template-columns: 1fr;
	}

	.sn-social-grid {
		grid-template-columns: 1fr;
	}

	.sn-social-grid .sn-form-group:last-child:nth-child(odd) {
		max-width: none;
	}

	.sn-avatar-field {
		flex-direction: column;
		align-items: flex-start;
	}
}
