/* base.css — global styles (typography, layout, forms, links)
   Includes Public/Cabinet page styles (public-*) */

:root{
  /* Colors */
  --bg: #f3f6ff;
  --surface: rgba(255,255,255,0.92);
  --surface-2: rgba(255,255,255,0.90);
  --border: rgba(30, 60, 120, 0.10);
  --text: #13203a;
  --muted: rgba(19,32,58,0.70);

  --primary: #2c6fff;
  --primary-2: #1f57d6;

  /* UI */
  --radius: 16px;
  --shadow-1: 0 10px 30px rgba(10,25,60,0.08);
  --shadow-2: 0 12px 40px rgba(10,25,60,0.10);
  --ring: rgba(44,111,255,0.22);

  /* Spacing */
  --container: 980px;

  /* Typography */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

*{ box-sizing: border-box; }

html, body{ height: 100%; }

body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img{
  max-width: 100%;
  height: auto;
  display: block;
}

a{ color: inherit; }

::selection{ background: rgba(44,111,255,0.22); }

/* Utility container */
.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 14px;
}

/* Accessible focus */
:focus-visible{
  outline: none;
  box-shadow: 0 0 0 4px var(--ring);
  border-radius: 10px;
}

/* Inputs/buttons base */
input, textarea, button, select{ font: inherit; }

input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
textarea,
select{
  width: 100%;
  border: 1px solid rgba(19, 32, 58, 0.14);
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  padding: 12px 12px;
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease;
}

textarea{
  min-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus{
  border-color: rgba(44,111,255,0.55);
  box-shadow: 0 0 0 4px var(--ring);
}

button{
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 180ms ease, filter 180ms ease;
}

button:active{ transform: translateY(0px); }

/* Simple card */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 14px 14px;
}

/* ---------------------------------------------
   Public/Cabinet pages
--------------------------------------------- */
body.public-page{
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(44,111,255,0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(99,102,241,0.14), transparent 58%),
    linear-gradient(180deg, #eef3ff, #f6f8ff);
  color: var(--text);
  padding: 18px 14px 28px;
}

body.cabinet-page{
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(34,197,94,0.14), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(16,185,129,0.10), transparent 58%),
    linear-gradient(180deg, #f1fff6, #f7fffb);
  color: var(--text);
  padding: 18px 14px 28px;
}

.public-wrap{
  max-width: var(--container);
  margin: 0 auto;
}

.public-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.public-title{
  margin: 0;
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.2px;
}

.public-new{
  display: inline-block;
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid #C0C0C0;
  color: bleed;
  background: aquamarine;
  box-shadow: 0 10px 25px rgba(44,111,255,0.22);
  text-align: center;
}
.public-new:hover{ filter: brightness(1.03); }
.public-new:active{ filter: brightness(0.98); }

.public-list{
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

/* ВАЖНО: единая высота и ровная сетка */
.public-row{
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 16px;

  box-sizing: border-box;
  min-height: 74px;
  padding: 16px 18px;

  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.public-row a{
	text-decoration: none;
	color: darkblue;
}

.public-row a:hover {
	color: cadetblue;
}

/* дата слева — всегда в одну строку */
.public-date{
  white-space: nowrap;
  opacity: .8;
  line-height: 1.2;
}

.public-link{
  color: var(--text);
  text-decoration: none;
  font-weight: 850;
  line-height: 1.25;
}
.public-link:hover{
  text-decoration: underline;
  color: var(--primary-2);
}

.public-empty{
  margin-top: 14px;
  padding: 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: rgba(19,32,58,0.70);
  box-shadow: var(--shadow-1);
}

/* Language switch */
.lang-switch{
  display: flex;
  gap: 8px;
  align-items: center;
}

.lang-link{
  text-decoration: none;
  font-weight: 800;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(19,32,58,0.14);
  background: rgba(255,255,255,0.65);
  color: rgba(19,32,58,0.85);
}
.lang-link:hover{ filter: brightness(0.98); }
.lang-link.active{
  background: rgba(44,111,255,0.12);
  border-color: rgba(44,111,255,0.30);
  color: #1f57d6;
}

/* Topbar / Brand */
.topbar{
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 14px;
  background: rgba(246,248,255,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(30, 60, 120, 0.10);
  border-radius: 16px;
  background: lemonchiffon;
}

.topbar-inner{
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo{
  width: 45px;
  height: 45px;
  display: block;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.12));
  margin-left: 5px;
}

.brand-text{
  display: grid;
  gap: 2px;
}

.brand-name{
  font-weight: 950;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.brand-tagline{
  font-size: 12px;
  color: rgba(19,32,58,0.68);
  line-height: 1.2;
}

.topbar-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hero block */
.hero{
  margin-top: 14px;
  padding: 16px 14px;
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(30, 60, 120, 0.10);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(10,25,60,0.10);
}

.hero-badges{
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(19,32,58,0.14);
  background: rgba(44,111,255,0.08);
  color: rgba(19,32,58,0.85);
}

/* Auth page */
body.auth-page{
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 14px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(44,111,255,0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(99,102,241,0.14), transparent 58%),
    linear-gradient(180deg, #eef3ff, #f6f8ff);
}

.auth-card{
  width: min(520px, 100%);
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(30, 60, 120, 0.10);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(10, 25, 60, 0.12);
  padding: 22px 18px;
}

.auth-title{
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 900;
}

.auth-hint{
  color: rgba(19,32,58,0.75);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 12px;
}

.flash-box{
  margin: 10px 0 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.10);
  border: 1px solid rgba(185, 28, 28, 0.18);
}
.flash{ color: green; font-size: 14px; }

.auth-label{
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  color: rgba(19,32,58,0.70);
}

.auth-input{ width: 100%; }

.auth-btn{
  margin-top: 16px;
  width: 100%;
  background: linear-gradient(180deg, #2c6fff, #1f57d6);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(44,111,255,0.25);
}
.auth-btn:hover{ filter: brightness(1.03); transform: translateY(-1px); }

.auth-links{ margin-top: 20px;}
.auth-links .link{
  color: rgba(19,32,58,0.75);
  text-decoration: none;
}
.auth-links .link:hover{ text-decoration: underline; }

/* Topbar links */
.top-link{
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(19,32,58,0.14);
  background: floralwhite;
  color: rgba(19,32,58,0.90);
}
.top-link:hover{ filter: brightness(0.98); }

/* Cabinet rows */
.cab-row{ display: contents; }

.cab-title{
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.6;
  margin: 0;
}

.cab-status{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(19,32,58,0.14);
  background: rgba(19,32,58,0.06);
  white-space: nowrap;
  justify-self: end;
  line-height: 1.2;
}

.status-approved{ background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.22); }
.status-pending{  background: rgba(245,158,11,0.14); border-color: rgba(245,158,11,0.22); }
.status-rejected{ background: rgba(220,38,38,0.12); border-color: rgba(220,38,38,0.20); }

/* Clickable row */
.public-row-link{
  display: block;      /* <a> как блок */
  color: inherit;
  text-decoration: none;
}

/* hover/focus без изменения border (чтобы не менялась высота) */
.public-row-link:hover,
.public-row-link:focus{
  text-decoration: none;
  outline: 2px solid rgba(37,99,235,.25);
  outline-offset: 0;
  border-radius: var(--radius);
}

.cab-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cab-title{
  flex: 1 1 auto;     /* чтобы заголовок занимал доступное место */
  min-width: 0;       /* важно для ellipsis */
}
.cab-status{
  flex: 0 0 auto;     /* статус не растягивается */
}

.top-auth{
  display:flex;
  gap:10px;
  align-items:center;
}

.top-auth .top-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:110px;   /* одинаковая ширина */
  padding:10px 12px; /* чтобы кнопки были “ровные” */
  line-height:1;
  white-space:nowrap;
}

/* базовый заголовок */
.cab-title{
  font-weight: 600;
}

/* pending: серый */
.cab-title-pending{
  color: rgba(0,0,0,0.55);
}

/* rejected: красноватый */
.cab-title-rejected{
  color: rgba(180, 50, 50, 0.9);
}

/* approved: “как ссылка” */
.cab-title-approved{
  color: rgba(20, 60, 160, 0.95);
}

/* когда строка является ссылкой — усиливаем эффект */
.public-row-link .cab-title{
  cursor: pointer;
}

.public-row-link:hover .cab-title{
  text-decoration: underline;
}

.hero-line{
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hero-line .public-title{
  margin: 0;
}

.hero-line .public-intro{
  margin: 0;
  margin-left: auto; /* прижать вправо */
  text-align: right;
}

.row{
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mini{
  display: inline-flex;
  align-items: center;
  gap: 8px;              /* вот это и “прижимает” текст к лого */
  text-decoration: none;
  color: inherit;
}

.brand-mini-text{
  font-size: 20px;
  line-height: 1;
}

.actions{
  margin-left: auto;     /* кнопки уедут вправо */
}














/* Mobile */
@media (max-width: 640px){
  html {
    font-size: 18px;
  }

  .topbar-inner{
    flex-direction: column;
    align-items: stretch;
  }
  .topbar-actions{
    justify-content: space-between;
  }
  .logo{
    width: 38px;
    height: 38px;
    border-radius: 0;   /* или 8px */
  }
  .public-row{
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: auto; /* на мобиле пусть растягивается */
  }

  .cab-status{
    justify-self: start; /* чтобы не уезжал вправо при 1 колонке */
  }

  .cab-head{
    flex-direction:column;
    align-items:flex-start;
  }

}


@media (max-width: 440px){
	.hero-line{
	  flex-wrap: wrap;
	}

	.hero-line .public-intro{
	  flex-basis: None;
	  margin-left: 0;
	  text-align: right;
	}
}










