:root {
    --bg: #f6efe7;
    --bg-soft: #fffaf5;
    --bg-2: #fffaf5;
    --card: #fffdf9;
    --text: #3a2f2a;
    --muted: #7a675d;
    --border: #e7d7c9;
    --line: #e7d7c9;
    --accent: #b86b4b;
    --accent-dark: #9f5639;
    --danger-bg: #fbe4e1;
    --danger-text: #8e2f25;
    --shadow: 0 20px 50px rgba(91, 56, 38, 0.12);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    min-height: 100%;
}

body {
    background-color: #f5f5f5;

    background-image:
        radial-gradient(circle at top,
            rgba(255, 248, 240, 0.75) 0%,
            rgba(246, 239, 231, 0.75) 48%,
            rgba(239, 227, 215, 0.75) 100%
        ),
        url('/kanta2/assets/kanta.png');

    background-repeat: no-repeat, no-repeat;

    /* 🔥 TÄMÄ ON TÄRKEIN */
    background-position: center top, left top;

    /* 🔥 tämä usein aiheuttaa keskitysongelman */
    background-size: cover, auto;

    background-attachment: fixed, fixed;
}

.login-body {
    min-height: 100vh;
}

.page-wrap {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 24px;
}
.card {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
	align-self: flex-start;
}

.dashboard-card {
    width: 100%;
    max-width: 1100px;
    padding: 28px;
}
.dashboard-card-form {
    max-width: 520px;
    margin: 0 auto;
	align-self: flex-start; /* 🔥 estää venymisen */
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px;
}
.panel {
    background: var(--bg-2);
	 background: rgba(255, 255, 255, 0.88); /* läpinäkyvä valkoinen */
    backdrop-filter: blur(2px); /* kevyt blur (valinnainen, moderni efekti) */
    border: 1px solid rgba(0,0,0,0.05); /* lähes näkymätön */
    border-radius: 16px;
    padding: 20px;
    min-width: 0;
	margin-bottom: 20px;
}

.panel p {
    max-width: 75ch;
}
input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 0.95rem;
    background: #fff;
    box-sizing: border-box;
}

/* selectille pieni lisäsäätö */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    min-height: 44px;
    padding: 10px 36px 10px 12px;

border: 1px solid var(--line);    border-radius: 10px;
    background-color: #fff;

    background-image: url("data:image/svg+xml;utf8,<svg fill='%23555555' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:hover {
    border-color: #b8a58e;
}

select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(200, 160, 120, 0.2);
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-1px);
}
.btn-secondary {
    background: #f1f1f1;
    border: 1px solid var(--line);
    color: #333;
}

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

.required {
    color: #b42318;
    font-weight: 700;
}
.brand {
    text-align: center;
    margin-bottom: 24px;
}
.brand p {
    text-align: left;
    max-width: 60ch;
    margin: 0 auto 12px;
}
.btn-primary {
    font-size: 1rem;
    padding: 12px 22px;
}
.brand h1 {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.2;
    color: var(--accent-dark);
}

.brand p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.info-box {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    line-height: 1.55;
}

.alert {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 0.95rem;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #efc2bc;
}

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

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-row select {
    display: block;
    width: 100%;

    min-height: 44px;
    padding: 10px 36px 10px 12px;

    border: 1px solid #cbbba8;
    border-radius: 10px;

    background-color: #ffffff; /* 👈 TÄMÄ TÄRKEÄ */
    color: #333;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    font-size: 0.95rem;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background-image: url("data:image/svg+xml;utf8,<svg fill='%23555555' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
label {
    font-weight: bold;
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #d8c5b5;
    border-radius: 12px;
    background: #fff;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(184, 107, 75, 0.12);
}

.btn-primary {
    appearance: none;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.05s ease;
	box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.btn-primary:hover {
    background: var(--accent-dark);
}

.btn-primary:active {
    transform: translateY(1px);
}

.login-footer {
    margin-top: 22px;
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.site-header {
    background: #fff;
    border-bottom: 1px solid #e5d6c8;
    position: sticky;
    top: 0;
    z-index: 20;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.logo a {
    font-weight: bold;
    font-size: 1rem;
    color: var(--accent-dark);
    text-decoration: none;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-wrap: wrap;
}

.main-nav a {
       height: 42px;
    padding: 0 12px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
	font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
	display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;

    padding: 0 18px;

    border-radius: 0;          /* ❗ pois pyöreys */
    border: none;              /* ❗ pois nappireuna */
    background: transparent;   /* ❗ ei taustaa */

    color: var(--text);
    font-weight: 600;
    text-decoration: none;

    position: relative;
    transition: color 0.2s ease, background 0.2s ease;
}
.main-nav a:hover {
    background: rgba(0, 0, 0, 0.05);
}
 
.main-nav a.active {
        background: var(--accent);
    color: #fff;
     
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 10px;
    right: 10px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.main-nav a.logout-link {
    background: #f8e7e0;
    border-color: #ebc9bc;
    color: #8f3c2e;
}

.main-nav a.logout-link:hover {
    background: #f3d9cf;
    border-color: #e2b8a7;
}

.nav-toggle {
    display: none;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    background: #f7eee6;
    border-radius: 12px;
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-dark);
    border-radius: 2px;
}
@media (min-width: 901px) {
    .main-nav {
        flex-wrap: nowrap;
    }
}
@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding-top: 10px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        width: 100%;
        justify-content: flex-start;
    }

    .logo {
        max-width: calc(100% - 62px);
    }

    .logo a {
        white-space: normal;
        line-height: 1.2;
        display: inline-block;
    }
}

.site-footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.alert-success {
    background: #e8f3e8;
    color: #2f6b38;
    border: 1px solid #c9e0c9;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

textarea {
    resize: vertical;
    min-height: 160px;
}

.profile-image {
    max-width: 350px;
    width: 100%;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--line);
    display: block;
}
.card,
.dashboard-card,
.listing-card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(2px);
	box-shadow: 0 4px 18px rgba(0,0,0,0.08);
}
.listing-card {
    border: 1px solid rgba(0,0,0,0.05); /* lähes näkymätön */
    border-radius: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.88);
    margin-top: 16px;
	margin-bottom: 20px;
}

.listing-card h3 {
    margin-top: 0;
    margin-bottom: 14px;
    color: var(--accent-dark);
}

.listing-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.listing-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.listing-item:last-child {
    border-bottom: 0;
}

.parents-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.thumb-image {
    width: 70px;
    max-width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--line);
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .listing-item {
        flex-direction: column;
    }

    .thumb-image {
        width: 100%;
        max-width: 180px;
        height: auto;
    }
}

.omasivu-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-top: 10px;
}

.omasivu-text {
    flex: 1;
    min-width: 0;
	    max-width: 65ch;
    line-height: 1.6;
}

.omasivu-image {
    flex-shrink: 0;
}

@media (max-width: 700px) {
    .omasivu-header {
        flex-direction: column;
    }

    .omasivu-image {
        order: -1; /* kuva tekstin yläpuolelle */
    }

    .profile-image {
        max-width: 100%;
    }
}