/** RESET */
* {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}

/** BASE */
html {
	font-size: 16px;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
	line-height: 1.6;
	color: #1a1a1a;
	background-color: #fafafa;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

/** LAYOUT */
.container {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	flex: 1;
}

/** HEADER */
.site-header {
	text-align: center;
	margin-bottom: 3rem;
}

.site-title {
	font-size: 2rem;
	font-weight: 600;
	color: #111;
	letter-spacing: -0.02em;
}

/** MASTHEAD */
.masthead {
	padding: 2rem 0 0;
}

.masthead-logo {
	text-align: center;
	margin-bottom: 1.5rem;
}

.masthead-logo .logo {
	height: 64px;
	width: auto;
}

.masthead-intro {
	text-align: center;
	margin-bottom: 3rem;
}

.masthead-title {
	font-size: 2.5rem;
	font-weight: 700;
	color: #111;
	letter-spacing: -0.02em;
	margin-bottom: 0.75rem;
}

.masthead-subtitle {
	font-size: 1.125rem;
	color: #666;
	max-width: 600px;
	margin: 0 auto;
}

.masthead-content {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
}

.prompt-visual {
	flex: 0 0 280px;
	max-width: 280px;
}

.invoice-visual {
	flex: 1;
	max-width: 480px;
}

.prompt-box {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 1.5rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.prompt-label {
	display: block;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #888;
	margin-bottom: 0.75rem;
}

.prompt-example {
	font-size: 0.85rem;
	color: #444;
	font-style: italic;
	line-height: 1.5;
}

.arrow {
	font-size: 2rem;
	color: #ccc;
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.invoice-image {
	width: 100%;
	height: auto;
}

/** DIVIDER */
.section-divider {
	border: none;
	height: 1px;
	background: linear-gradient(to right, transparent, #e0e0e0 15%, #e0e0e0 85%, transparent);
	margin: 3rem 0;
	position: relative;
}

.section-divider::after {
	content: '';
	position: absolute;
	top: 1px;
	left: 0;
	right: 0;
	height: 24px;
	background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(0, 0, 0, 0.06), transparent);
	pointer-events: none;
}

/** FORM SECTION */
.form-section {
	width: 100%;
	max-width: 600px;
	padding-bottom: 1rem;
	margin: 0 auto 1.875rem;
}

.form-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: #111;
	margin-bottom: 1.5rem;
	text-align: center;
}

.invoice-form {
	width: 100%;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 2rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
	box-sizing: border-box;
}

.form-row {
	display: flex;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.form-row .form-group {
	flex: 1;
}

.form-group {
	margin-bottom: 1.25rem;
}

.form-group label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	color: #333;
	margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
	width: 100%;
	padding: 0.75rem 1rem;
	font-size: 0.95rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	background: #fafafa;
	transition: border-color 0.2s, background-color 0.2s;
	font-family: inherit;
}

.form-group select {
	height: auto;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	padding-right: 2.5rem;
	cursor: pointer;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
	outline: none;
	border-color: #111;
	background: #fff;
}

.form-group textarea {
	min-height: 120px;
	resize: vertical;
	font-family: inherit;
	line-height: 1.7;
}

.submit-btn {
	width: 100%;
	padding: 0.875rem 1.5rem;
	font-size: 1rem;
	font-weight: 500;
	color: #fff;
	background: #111;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s;
}

.submit-btn:hover {
	background: #333;
}

.submit-btn:disabled {
	cursor: not-allowed;
	opacity: 0.7;
}

.submit-btn--loading {
	background: #444;
	animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
	0%, 100% {
		opacity: 0.7;
	}
	50% {
		opacity: 1;
	}
}

/** FORM ERRORS */
.input-wrapper {
	position: relative;
}

.field-error {
	position: absolute;
	top: 0;
	right: 0.75rem;
	transform: translateY(-50%);
	background: #fff;
	color: #dc2626;
	font-size: 0.75rem;
	font-weight: 500;
	padding: 0 0.5rem;
	z-index: 1;
}

.input-error {
	border-color: #dc2626 !important;
	background: #fff !important;
}

.input-error:focus {
	border-color: #dc2626 !important;
}

/** RESPONSIVE */
@media (max-width: 768px) {
	.container {
		padding: 1.5rem 1rem;
	}
	
	.masthead-title {
		font-size: 2rem;
		line-height: 1.2;
	}
	
	.masthead-subtitle {
		font-size: 1rem;
	}
	
	.masthead-content {
		flex-direction: column;
		gap: 0.5rem;
	}
	
	.arrow {
		transform: rotate(90deg);
		margin: 0;
	}
	
	.prompt-visual,
	.invoice-visual {
		max-width: 100%;
		width: 100%;
		flex: none;
	}
	
	.invoice-placeholder {
		min-height: 200px;
		max-height: 280px;
		aspect-ratio: auto;
	}
	
	.form-row {
		flex-direction: column;
		gap: 0;
	}
	
	.form-section {
		max-width: 100%;
	}
	
	.invoice-form {
		padding: 1.5rem;
	}
}

@media (max-width: 480px) {
	.site-title {
		font-size: 1.5rem;
	}
	
	.masthead-title {
		font-size: 1.5rem;
		line-height: 1.15;
	}
	
	.masthead-subtitle {
		font-size: 0.95rem;
	}
	
	.site-header {
		margin-bottom: 2rem;
	}
	
	.masthead {
		padding: 1rem 0 2rem;
	}
	
	.masthead-logo .logo {
		height: 48px;
	}
	
	.prompt-box {
		padding: 1rem;
	}
	
	.prompt-example {
		font-size: 0.8rem;
	}
	
	.invoice-placeholder {
		min-height: 160px;
		max-height: 220px;
	}
	
	.form-title {
		font-size: 1.1rem;
	}
	
	.invoice-form {
		padding: 1rem;
		border-radius: 8px;
	}
	
	.form-group input,
	.form-group select,
	.form-group textarea {
		padding: 0.65rem 0.875rem;
		font-size: 0.9rem;
	}
	
	.submit-btn {
		padding: 0.75rem 1rem;
	}
}

/** FAQ SECTION */
.faq-section {
	max-width: 700px;
	margin: 0 auto;
	padding: 0 1rem;
}

.faq-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: #111;
	margin-bottom: 1.5rem;
	text-align: center;
}

.faq-item {
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	margin-bottom: 0.75rem;
	background: #fff;
	overflow: hidden;
}

.faq-item summary {
	padding: 1rem 1.25rem;
	font-weight: 500;
	color: #222;
	cursor: pointer;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
	display: none;
}

.faq-item summary::after {
	content: '+';
	font-size: 1.25rem;
	color: #888;
	transition: transform 0.2s;
}

.faq-item[open] summary::after {
	content: '−';
}

.faq-item[open] summary {
	border-bottom: 1px solid #e0e0e0;
}

.faq-item summary:hover {
	background: #fafafa;
}

.faq-content {
	padding: 1rem 1.25rem 1.25rem;
	color: #555;
	font-size: 0.95rem;
	line-height: 1.6;
}

.faq-content p {
	margin-bottom: 0.75rem;
}

.faq-content p:last-child {
	margin-bottom: 0;
}

.faq-content ul,
.faq-content ol {
	margin: 0.5rem 0 0.75rem 1.5rem;
}

.faq-content li {
	margin-bottom: 0.25rem;
}

.faq-content a {
	color: #2563eb;
	text-decoration: underline;
}

.faq-content a:hover {
	color: #1d4ed8;
}

.faq-content strong {
	color: #111;
	font-weight: 600;
}

.faq-content .arrow-icon {
	vertical-align: middle;
	margin: 0 0.25em;
	opacity: 0.5;
}

.faq-content .code {
	background: #f8f8f8;
	padding: 0.15em 0.4em;
	border-radius: 4px;
	border: 1px solid #ccc;
	font-size: 0.85em;
	color: #333;
}

/** FOOTER */
.site-footer {
	text-align: center;
	padding: 2rem 1rem;
	margin-top: auto;
	color: #999;
	font-size: 0.875rem;
}

.site-footer a {
	color: #2563eb;
	text-decoration: underline;
	transition: color 0.2s;
}

.site-footer a:hover {
	color: #1d4ed8;
}

/** MESSAGE PAGE */
.message-page {
	max-width: 600px;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	text-align: center;
	flex: 1;
}

.message-page-logo {
	margin-bottom: 2rem;
}

.message-page-logo .logo {
	height: 48px;
	width: auto;
}

.message-page-title {
	font-size: 2rem;
	font-weight: 700;
	color: #111;
	margin-bottom: 1.5rem;
}

.message-page-text {
	color: #666;
	margin-bottom: 1rem;
}

.message-page-link {
	margin-top: 2rem;
}

.message-page-link a {
	color: #2563eb;
	text-decoration: underline;
	transition: color 0.2s;
}

.message-page-link a:hover {
	color: #1d4ed8;
}

/* Error Box */
.error-box {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	padding: 1.25rem 1.5rem;
	margin: 1.5rem 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	text-align: left;
}

.error-box-text {
	color: #991b1b;
	font-size: 0.95rem;
	line-height: 1.6;
	margin: 0;
}