/* --- Base styles --- */
:root {
    --gap: 16px;
    --radius: 12px;
    /*colors*/
    --smoky: #f5edd9;
    --dark: #343231;
    --grey-light: #c8c7c5;
    --grey-dark: #aaa8a3;
    --orange: #f2a84a;
    --yellow: #e0cb6d;
    --green-light: #b3bd6e;
    --green-dark: #535734;
    --blue-dark: #203350;
    --blue-light: #6f8abe;
    --brown-light: #9f4630;
    --brown-dark: #3c1910;
    --red-light: #c9322d;
    --red-dark: #a91710;
}


* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100svh;
    /* instat fixed 100vh (mobiles Safari) */
    height: auto;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    line-height: 1.5;
    color: var(--smoky);
    background: var(--dark);
    overflow-x: hidden;
}

/* --- Layout --- */
header,
footer {
    background: var(--grey-dark);
    border-bottom: 1px solid var(--grey-light);
    color: var(--smoky);
}

header {
    position: sticky;
    top: 0;
    z-index: 10;
}

.wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px var(--gap);
}

.headbar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* gap: var(--gap); */
    flex-direction: row;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--tile-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo {
    width: 36px;
    height: 36px;
    margin-right: 24px;
}

.brand span {
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: .2px;
}

/* --- Header links --- */
.spacer {
    flex: 1;
}

.headlinks {
    display: none;
    gap: 14px;
    align-items: center;
}

.headlinks a {
    text-decoration: none;
    color: var(--smoky);
    padding: 6px 10px;
    border-radius: 8px;
}

.headlinks a:hover {
    background: #f0f0f2;
}

/* --- Burger --- */
.burger {
    background: none;
    border: 1px solid var(--grey-light);
    color: var(--smoky);
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
}

.burger:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

/* --- Mobile menu --- */
.drawer {
    display: none;
    padding: 8px 0 12px;
    position: fixed;
    right: 0px;
    max-width: max-content;
    background-color: var(--grey-light);
    border-radius: 0 0 0 5px;
}

.drawer a {
    display: block;
    text-decoration: none;
    color: var(--smoky);
    padding: 10px;
    border-radius: 8px;
}

.drawer a:hover {
    background: #f0f0f2;
    color: var(--grey-dark);
}

/* --- Main --- */
main {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    /* for overflow  */
    overflow: auto;
    /* overscroll input */
    width: 100%;
    display: flex;
}

main .wrap {
    padding-top: 28px;
    padding-bottom: 28px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
}

.info {
    margin: 0 0 24px;
    color: var(--smoky);
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--smoky);
    border: 1px solid var(--grey-light);
    color: var(--dark);
    border-radius: var(--radius);
    padding: 16px;
}

.card h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.card p {
    margin: 0 0 12px;
    color: #444;
}

.card a.btn {
    align-self: flex-end;
    margin-top: auto;
    color: var(--smoky);
    background-color: var(--grey-light);
    display: inline-block;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--grey-dark);
}

.card a.btn:hover {
    color: var(--grey-light);
    background-color: var(--grey-dark);
}

/* --- Footer --- */
footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    border-top: 1px solid var(--grey-light);
}

footer .wrap {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

footer nav a {
    color: var(--smoky);
    text-decoration: none;
    margin-right: 12px;
}

footer nav a:hover {
    text-decoration: underline;
}

/* --- Responsive --- */
@media (min-width: 760px) {
    .headlinks {
        display: flex;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* password overlay styles (scoped with pw- prefix) */
.pw-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  color: #111;
}
.pw-hidden { display: none; }

.pw-card {
  background: #fff;
  max-width: 420px;
  width: 92%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  padding: 1rem;
}

.pw-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.pw-header h2 { margin: 0; font-size: 1.1rem; }

.pw-body { display: grid; gap: .6rem; margin-top: .6rem; }
.pw-row { display: grid; gap: .35rem; }

.pw-actions {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  margin-top: .4rem;
}

.pw-input {
  padding: .6rem .7rem;
  border: 1px solid #d5d5d5;
  border-radius: .5rem;
  font-size: 1rem;
}
.pw-error { color: #b00020; font-size: .9rem; min-height: 1em; }

.pw-btn {
  padding: .5rem .8rem;
  border: 1px solid #c8c8c8;
  border-radius: .5rem;
  background: #f5f5f5;
  cursor: pointer;
}
.pw-btn.primary {
  background: #111;
  color: #fff;
  border-color: #111;
}
.pw-close {
  background: transparent;
  border: 0;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}
