/* ===== Perus ===== */

body {
	margin: 0;
	font-family: "Inter", Arial, sans-serif;
	background: #F4F6F8;
	color: #1C2A3A;
}

/* ===== Topbar ===== */


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

.container {
	display: flex;
	min-height: calc(100vh - 80px);
}

.sidebar {
	width: 260px;
	background: white;
	border-right: 1px solid #E6E8EB;
	padding: 30px 20px;
}

.content {
	flex: 1;
	padding: 50px;
	max-width: 900px;
}

/* ===== Sidebar items ===== */

.section-item {
	padding: 12px 14px;
	margin-bottom: 12px;
	border-radius: 8px;
	font-size: 14px;
	transition: 0.2s ease;
}

.section-item.complete {
	background: #E8F5E9;
	color: #2E7D32;
	font-weight: 500;
}

.section-item.incomplete {
	background: #FFF4E5;
	color: #8B6F47;
	font-weight: 500;
}

.section-item.not_started {
	background: #F4F6F8;
	color: #6B7280;
}

.section-item:hover {
	background: #EEF1F4;
}

/* ===== Otsikko ===== */

h2 {
	margin-top: 0;
	margin-bottom: 30px;
	font-weight: 600;
}

/* ===== Lomake ===== */

form {
	background: white;
	padding: 35px;
	border-radius: 12px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}

label {
	display: block;
	font-size: 13px;
	margin-bottom: 6px;
	color: #6B7280;
}

input {
	width: 90%;
	padding: 10px 12px;
	margin-bottom: 20px;
	border: 1px solid #E0E0E0;
	border-radius: 6px;
	font-size: 14px;
	transition: border 0.2s ease;
}

input:focus {
	outline: none;
	border-color: #8B6F47;
}

/* ===== Button ===== */

button {
	background: #1C2A3A;
	color: white;
	border: none;
	padding: 12px 20px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	transition: background 0.2s ease;
}

button:hover {
	background: #2A3B52;
}

/* ===== Progress bar ===== */

.progress-wrapper {
	margin-bottom: 25px;
}

.progress-label {
	font-size: 12px;
	margin-bottom: 6px;
	color: #6B7280;
}

.progress-bar {
	width: 100%;
	height: 6px;
	background: #E5E7EB;
	border-radius: 10px;
	overflow: hidden;
}

.progress-fill {
	height: 100%;
	background: #8B6F47;
	transition: width 0.3s ease;
}

.section-icon {
	margin-right: 8px;
	font-weight: bold;
}
.save-message {
	margin-top: 20px;
	padding: 12px 15px;
	background: #E8F5E9;
	color: #2E7D32;
	border-radius: 6px;
	font-size: 14px;
}

.section-item.active {
	border-left: 4px solid #8B6F47;
	padding-left: 10px;
}

.heir-card {
	background: #F8FAFC;
	border: 1px solid #E2E8F0;
	padding: 15px;
	border-radius: 8px;
	margin-bottom: 15px;
}

select {
	width: 93%;
	margin-bottom: 10px;
	padding: 14px;
	border: 1px solid #E5E7EB;
	border-radius: 8px;
	font-size: 14px;
	background: white;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	box-sizing: border-box;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%231C2A3A' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 12px;
	cursor: pointer;
}

select:focus {
	outline: none;
	border-color: #8B6F47;
	box-shadow: 0 0 0 2px rgba(139,111,71,0.15);
}

.certificate-block {
	background: #F8FAFC;
	border: 1px solid #E2E8F0;
	padding: 20px;
	border-radius: 8px;
	margin-bottom: 25px;
}

.tcard, .deceased-card,
.heir-card {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 16px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	margin-bottom: 16px;
	background: #f9fafb;
}

.card-actions {
	margin-left: 20px;
}

.edit-btn {
	background: #f1f1f1;
	border: none;
	padding: 6px 12px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 14px;
}

.edit-btn:hover {
	background: #e2e2e2;
}

.cert-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	background: #f9fafb;
	margin-top: 10px;
	margin-bottom: 10px;
}


.add-btn:hover {
	opacity: 0.9;
}
.heir-card {
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	margin-bottom: 16px;
	background: #f9fafb;
	padding: 16px;
}

.heir-summary {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.edit-heir-form {
	margin-top: 10px;
	display: block;
	width: 100%;
}

.edit-heir-form input {
	width: 100%;
}

.card-actions {
	margin-left: 20px;
}

.add-btn {
	margin-top: 15px;
	padding: 10px 16px;
	border-radius: 6px;
	background: #1f2d3d;
	color: white;
	border: none;
	cursor: pointer;
}

#spouseCertificateForm {
	margin-bottom: 10px;
}

.heir-summary {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	width: 100%;
}

.card-content {
	flex: 1;
}

.card-actions {
	margin-left: 20px;
	flex-shrink: 0;
}

.edit-heir-btn {
	white-space: nowrap;
}

.intro-box {
	background: #f9fafb;
	padding: 24px;
	border-radius: 8px;
	border: 1px solid #e2e2e2;
	line-height: 1.6;
}

.intro-box h3 {
	margin-top: 20px;
}

.primary-btn {
	margin-top: 20px;
	padding: 12px 20px;
	background: #1f2d3d;
	color: white;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 15px;
}

.primary-btn:hover {
	opacity: 0.9;
}

.asset-card {
	background: #f4f6f8;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}


.expense-card {
	background: #f4f6f8;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
}

.card-inner {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}

.card-content {
	line-height: 1.6;
}

.card-actions {
	margin-left: 20px;
}

.card-actions button {
	background: #1f2d3d;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 6px;
	cursor: pointer;
}

.doc-status {
	margin-top: 8px;
	font-size: 14px;
}

.doc-status.success {
	color: #2e7d32;
}

.doc-status.warning {
	color: #c62828;
}

.doc-title {
	margin-top: 20px;
	font-weight: 600;
	font-size: 14px;
	opacity: 0.8;
}

.doc-item {
	margin-top: 6px;
	padding: 6px 10px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
}

.doc-item.missing {
	background: #fff3f3;
	color: #c0392b;
}

.testament-options {
	display: flex;
	gap: 24px;
	margin: 30px 0;
}


.testament-card {
	flex: 1;
	border: 2px solid #d1d5db;
	border-radius: 14px;
	padding: 24px;
	cursor: pointer;
	transition: all 0.2s ease;
	background: #ffffff;
}

.testament-card input {
	position: absolute;
	opacity: 0;
}

.testament-card.selected {
	border-color: #1f2937;
	background: #1f2937;
	color: #ffffff;
}

.testament-card.selected .card-desc {
	color: #e5e7eb;
}

.save-success {
	background: #e8f5e9;
	color: #2e7d32;
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 15px;
	font-weight: 500;
}

/* === ESTATE SUMMARY === */

.estate-summary {
	margin-top: 24px;
	padding: 18px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 4px 18px rgba(0,0,0,0.06);
	font-size: 14px;
}

.summary-block h4 {
	margin: 0 0 14px 0;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #6b7280;
}

.summary-row {
	display: flex;
	justify-content: space-between;
	margin-bottom: 6px;
}

.summary-row span:last-child {
	font-weight: 500;
}

.summary-divider {
	height: 1px;
	background: #e5e7eb;
	margin: 10px 0;
}

.summary-total {
	font-weight: 600;
}

.summary-net {
	margin-top: 10px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f3f4f6;
	font-size: 15px;
	font-weight: 700;
}

.summary-net.positive {
	background: #ecfdf5;
	color: #065f46;
}

.summary-net.negative {
	background: #fef2f2;
	color: #991b1b;
}

.section-subtitle {
	margin-top: 10px;
	margin-bottom: 15px;
	font-size: 16px;
	font-weight: 600;
	color: #1f2d3d;
}

.checkbox-row {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
	margin-bottom: 10px;
}

.details-block {
	margin-top: 25px;
}

.nested-block {
	margin-top: 10px;
	padding-left: 25px;
}

/* ===== Toggle Row ===== */

.toggle-row {
	margin-top: 25px;
}

.toggle-label {
	display: flex;
	align-items: center;
	gap: 14px;
	cursor: pointer;
	font-weight: 500;
	color: #1f2d3d;
}

/* piilotetaan default checkbox */
.toggle-label input {
	display: none;
}

/* custom box */
.toggle-box {
	width: 20px;
	height: 20px;
	border-radius: 6px;
	border: 2px solid #c9ced6;
	background: white;
	transition: all 0.2s ease;
}

/* checked state */
.toggle-label input:checked + .toggle-box {
	background: #1f2d3d;
	border-color: #1f2d3d;
}

/* checkmark */
.toggle-label input:checked + .toggle-box::after {
	content: "";
	position: relative;
	display: block;
	width: 6px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
	margin: 2px auto;
}

/* ===== Textarea ===== */

textarea {
	width: 90%;
	min-height: 100px;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid #d5d9df;
	background: #f9fafb;
	font-family: inherit;
	font-size: 14px;
	transition: all 0.2s ease;
}

textarea:focus {
	outline: none;
	border-color: #1f2d3d;
	background: white;
}

/* ===== Success message ===== */

.form-success {
	margin-top: 18px;
	padding: 10px 14px;
	border-radius: 8px;
	background: #e6f4ea;
	color: #1b5e20;
	font-weight: 500;
	display: none;
}

/* ===== Field Labels ===== */

.field-label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #4a5568;
}

/* ===== Text Input ===== */

.text-input {
	width: 88%;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid #d5d9df;
	background: #f9fafb;
	transition: all 0.2s ease;
}

.text-input:focus {
	outline: none;
	border-color: #1f2d3d;
	background: white;
}

/* ===== Modern Textarea ===== */

.modern-textarea {
	width: 100%;
	min-height: 110px;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid #d5d9df;
	background: #f9fafb;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
	transition: all 0.2s ease;
}

.modern-textarea:focus {
	outline: none;
	border-color: #1f2d3d;
	background: white;
}

/* ===== Nested spacing ===== */

.nested-block {
	margin-top: 14px;
	padding-left: 34px;
}

.notes-block {
	margin-top: 18px;
}

.info-box {
	background: #f4f6f9;
	padding: 14px 16px;
	border-radius: 10px;
	margin-bottom: 25px;
	font-size: 14px;
	line-height: 1.5;
	color: #344054;
}

.info-box ul {
	margin: 8px 0 0 18px;
}

.field-hint {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	color: #667085;
	line-height: 1.4;
}

/* ===== Unified form width ===== */

.form-inner {
	max-width: 900px;   /* sama visuaalinen leveys kuin tasinko-korteilla */
	margin: 0 auto;
}

.form-inner .text-input,
.form-inner .modern-textarea {
	width: 90%;
}

/* ===== Deceased Card ===== */

.deceased-name {
	font-size: 20px;
	font-weight: 600;
	margin-bottom: 16px;
	color: #1f2d3d;
}

.info-row {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 10px;
}

.info-row .label {
	font-size: 13px;
	color: #667085;
	min-width: 150px;
}

.info-row .value {
	font-size: 14px;
	color: #1f2d3d;
	text-align: right;
}

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

.checkbox-row {
	margin-top: 14px;
	margin-bottom: 14px;
}

.checkbox-wrapper {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	color: #1f2d3d;
}

/* Moderni checkbox */
.checkbox-wrapper input[type="checkbox"] {
	appearance: none;
	width: 18px;
	height: 18px;
	border: 2px solid #cbd5e1;
	border-radius: 5px;
	position: relative;
	cursor: pointer;
	transition: all 0.2s ease;
}

.checkbox-wrapper input[type="checkbox"]:checked {
	background: #1f2d3d;
	border-color: #1f2d3d;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
	content: "✓";
	color: white;
	font-size: 12px;
	position: absolute;
	left: 3px;
	top: -1px;
}
/* ===== Form group ===== */

/* ===== Toggle Card ===== */

.toggle-card {
	border: 2px solid #e5e7eb;
	border-radius: 14px;
	padding: 18px;
	margin-top: 16px;
	cursor: pointer;
	transition: all 0.2s ease;
	width: 89%;
	margin-bottom: 16px;
}

.toggle-card:hover {
	border-color: #1f2d3d;
}

.toggle-card.selected {
	background: #1f2d3d;
	border-color: #1f2d3d;
	color: white;
}

.toggle-title {
	font-weight: 600;
	font-size: 15px;
}

.toggle-sub {
	font-size: 13px;
	opacity: 0.8;
	margin-top: 4px;
}

.save-message {
	margin-top: 15px;
	background: #e6f4ea;
	color: #1f2d3d;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
}

.topbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 30px;
	background: #111;
	color: #fff;
}

.user-info {
	display: flex;
	gap: 15px;
	align-items: center;
}

.user-info a {
	color: #fff;
	text-decoration: none;
	opacity: 0.8;
}

.user-info a:hover {
	opacity: 1;
}

.intro-welcome {
	background: #193652;
	border-radius: 12px;
	padding: 36px 40px;
	margin-bottom: 28px;
	text-align: center;
}

.intro-welcome-icon {
	font-size: 36px;
	margin-bottom: 12px;
}

.intro-welcome-title {
	font-size: 24px;
	font-weight: 700;
	color: #FCFBFA;
	margin: 0 0 12px;
}

.intro-welcome-lead {
	font-size: 15px;
	color: rgba(252,251,250,0.75);
	line-height: 1.65;
	max-width: 560px;
	margin: 0 auto 24px;
}

.intro-badges {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
}

.intro-badge {
	background: rgba(217,174,148,0.15);
	border: 1px solid rgba(217,174,148,0.3);
	color: #D9AE94;
	font-size: 13px;
	font-weight: 500;
	padding: 6px 14px;
	border-radius: 20px;
}

/* ── Section headers ── */
.intro-section {
	margin-bottom: 32px;
	padding-bottom: 32px;
	border-bottom: 1px solid #e5e7eb;
}

.intro-section:last-of-type {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.intro-section-header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 14px;
}

.intro-section-num {
	width: 32px;
	height: 32px;
	min-width: 32px;
	background: #193652;
	color: #FCFBFA;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
}

.intro-section-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1C2A3A;
}

/* ── List ── */
.intro-list {
	padding-left: 0;
	margin: 12px 0;
	list-style: none;
}

.intro-list li {
	padding: 7px 0 7px 20px;
	position: relative;
	font-size: 14px;
	color: #344054;
	line-height: 1.5;
	border-bottom: 1px solid #f3f4f6;
}

.intro-list li:last-child {
	border-bottom: none;
}

.intro-list li::before {
	content: '–';
	position: absolute;
	left: 0;
	color: #D9AE94;
	font-weight: 700;
}

/* ── Tip box ── */
.intro-tip {
	margin-top: 14px;
	background: #f0f4f8;
	border-left: 3px solid #193652;
	padding: 12px 16px;
	border-radius: 0 8px 8px 0;
	font-size: 13px;
	color: #344054;
	line-height: 1.5;
}

/* ── Steps ── */
.intro-steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 12px;
}

.intro-step {
	display: flex;
	align-items: center;
	gap: 14px;
}

.intro-step-dot {
	width: 28px;
	height: 28px;
	min-width: 28px;
	background: #f0f4f8;
	border: 2px solid #193652;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: #193652;
}

.intro-step-text {
	font-size: 14px;
	color: #344054;
}

/* ── Topbar ── */
.topbar {
	background: #193652 !important;
	padding: 0 32px !important;
	height: 60px;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
}

.topbar-brand {
	display: flex;
	align-items: center;
	gap: 14px;
}

.topbar-logo {
	height: 24px;
	width: auto;
}

.topbar-divider {
	width: 1px;
	height: 20px;
	background: rgba(252,251,250,0.25);
}

.topbar-service {
	font-size: 13px;
	color: rgba(252,251,250,0.70);
	letter-spacing: 0.05em;
	font-family: sans-serif;
}

.user-email {
	font-size: 13px;
	color: rgba(252,251,250,0.65);
}

.topbar-link {
	font-size: 13px;
	color: rgba(252,251,250,0.80) !important;
	text-decoration: none !important;
	transition: color 0.15s;
}

.topbar-link:hover {
	color: #FCFBFA !important;
}

.topbar-logout {
	background: rgba(252,251,250,0.10);
	padding: 6px 14px;
	border-radius: 5px;
	font-size: 12px;
	letter-spacing: 0.03em;
}

.topbar-logout:hover {
	background: rgba(252,251,250,0.18) !important;
}

.topbar-logo {
	height: 24px;
	width: auto;
	filter: brightness(0) invert(1);
}

/* =============================================
   FINALIZATION & GENERAL SECTION IMPROVEMENTS
   Lisää style.css:n loppuun
   ============================================= */

/* ── Section blocks ── */
.section-block {
	margin-bottom: 40px;
}

.section-title {
	font-size: 20px;
	font-weight: 600;
	color: #1C2A3A;
	margin: 0 0 20px;
	padding-top: 8px;
	border-top: 2px solid #e5e7eb;
}

/* ── Upload row ── */
.upload-row {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 16px;
}

.upload-label-input {
	width: 220px !important;
	margin-bottom: 0 !important;
}

/* ── Attachment / cert card ── */
.cert-card {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	background: #f9fafb;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	margin-top: 10px;
	font-size: 14px;
}

.cert-info {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #1C2A3A;
}

.cert-icon {
	font-size: 16px;
	opacity: 0.7;
}

.empty-note {
	font-size: 14px;
	color: #9ca3af;
	margin-top: 12px;
}

/* ── Status card (locked) ── */
.status-card {
	display: flex;
	gap: 16px;
	padding: 20px 24px;
	border-radius: 10px;
	align-items: flex-start;
}

.status-card--locked {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
}

.status-card-icon {
	font-size: 22px;
	flex-shrink: 0;
	margin-top: 2px;
}

.status-card-body strong {
	display: block;
	font-size: 15px;
	color: #0c4a6e;
	margin-bottom: 6px;
}

.status-card-body p {
	font-size: 14px;
	color: #0369a1;
	margin: 0;
	line-height: 1.55;
}

/* ── Finalize box ── */
.finalize-box {
	background: white;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 28px;
}

.finalize-box p {
	font-size: 14px;
	color: #4b5563;
	line-height: 1.65;
	margin-bottom: 14px;
}

.field-group {
	margin-top: 20px;
	margin-bottom: 4px;
}

.finalize-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 24px;
	flex-wrap: wrap;
}

.finalize-submit-btn {
	margin-left: auto;
}

/* ── Danger button ── */
.danger-btn {
	background: #fff1f0;
	color: #c0392b;
	border: 1px solid #fecaca;
	padding: 6px 14px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.15s;
}

.danger-btn:hover {
	background: #fee2e2;
}

/* ── Secondary button ── */
.secondary-btn {
	background: #f3f4f6;
	color: #1C2A3A;
	border: 1px solid #e5e7eb;
	padding: 10px 18px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s;
}

.secondary-btn:hover {
	background: #e9eaec;
}

/* ── Info box success variant ── */
.info-box.success {
	background: #f0fdf4;
	border-left: 3px solid #16a34a;
	color: #166534;
}