:root{
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:#eaf7f8;
  background:#071116;

  --bg:#071116;
  --bg-2:#071922;
  --bg-soft:#0b171c;
  --card:#0f1b20;
  --card-solid:#0f1b20;
  --glass:rgba(255,255,255,.03);

  --text:#eaf7f8;
  --muted:#9fb3b8;
  --muted-2:#71868c;

  --accent:#33d6df;
  --accent-2:#7be495;
  --accent-soft:rgba(51,214,223,.12);
  --focus-glow:rgba(51,214,223,.25);

  --success:#7be495;
  --success-bg:rgba(123,228,149,.08);
  --danger:#ff6b73;
  --danger-bg:rgba(255,107,115,.08);
  --warning:#ffd166;
  --warning-bg:rgba(255,209,102,.08);

  --line:rgba(255,255,255,.07);
  --line-soft:rgba(255,255,255,.03);
  --border:rgba(255,255,255,.06);

  --shadow:0 12px 36px rgba(2,6,12,.45);
  --shadow-soft:0 8px 20px rgba(2,6,12,.35);

  --radius:20px;
  --radius-md:16px;
  --radius-sm:12px;

  --content:980px;
}

:root[data-theme="light"]{
  color:#072022;
  background:#f3f7f6;

  --bg:#f3f7f6;
  --bg-2:#eef6f5;
  --bg-soft:#fff;
  --card:#fbfdfc;
  --card-solid:#fbfdfc;
  --glass:rgba(2,10,12,.04);

  --text:#072022;
  --muted:#3f5561;
  --muted-2:#71808a;

  --accent:#00686e;
  --accent-2:#09744a;
  --accent-soft:rgba(0,104,110,.08);
  --focus-glow:rgba(0,104,110,.2);

  --success:#09744a;
  --success-bg:#edf8f1;
  --danger:#b33e55;
  --danger-bg:#fff0f3;
  --warning:#9b6c12;
  --warning-bg:#fff8e7;

  --line:rgba(2,20,20,.08);
  --line-soft:rgba(2,20,20,.04);
  --border:rgba(2,20,20,.08);

  --shadow:0 8px 20px rgba(2,6,12,.06);
  --shadow-soft:0 6px 18px rgba(2,6,12,.05);
}

/* =========================================================
   GLOBAL
   ========================================================= */

*,
*::before,
*::after{
  box-sizing:border-box;
}

html{
  min-height:100%;
  scroll-behavior:smooth;
}

body{
  min-height:100vh;
  margin:0;
  overflow-x:hidden;
  background:
    radial-gradient(900px 500px at 15% -10%,rgba(18,70,77,.34),transparent 60%),
    radial-gradient(700px 450px at 100% 100%,rgba(18,55,48,.28),transparent 60%),
    linear-gradient(180deg,var(--bg),var(--bg-2));
  color:var(--text);
}

:root[data-theme="light"] body{
  background:
    radial-gradient(900px 500px at 15% -10%,rgba(0,104,110,.08),transparent 60%),
    radial-gradient(700px 450px at 100% 100%,rgba(9,116,74,.06),transparent 60%),
    linear-gradient(180deg,var(--bg),var(--bg-2));
}

body,
button,
input,
select,
textarea{
  font:inherit;
}

button,
input,
select,
textarea{
  -webkit-tap-highlight-color:transparent;
}

button,
input,
select,
textarea{
  border-radius:12px;
}

button{
  border:0;
}

button:disabled{
  cursor:not-allowed;
  opacity:.55;
}

img,
svg{
  display:block;
  max-width:100%;
}

::selection{
  background:rgba(51,214,223,.22);
  color:#fff;
}

a{
  color:inherit;
}

/* =========================================================
   LAYOUT
   ========================================================= */

.page{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.page-main{
  flex:1;
}

.shell{
  width:min(var(--content),calc(100% - 40px));
  margin:0 auto;
  padding:34px 0 28px;
}

.container{
  width:min(var(--content),100%);
  margin:0 auto;
}

.center{
  min-height:100%;
  display:flex;
  justify-content:center;
  align-items:center;
}

.narrow{
  width:min(560px,100%);
  margin:0 auto;
}

/* =========================================================
   BRAND
   ========================================================= */

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: inherit;
  text-decoration: none;
}

.logo {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  color: #071116;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.logo img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

/* =========================================================
   AUTH LOGO — WITHOUT GREEN
   ========================================================= */

.auth-brand {
  margin: 0 0 10px;
}

.auth-brand .logo {
  border-radius: 14px;
  background: rgba(123, 228, 149, 0.14) !important;
  background-image: none !important;
  border: 1px solid rgba(123, 228, 149, 0.18);
  color: #eaf7f8;
  box-shadow: 0 4px 14px rgba(123, 228, 149, 0.10);
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {
  .logo {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    flex-basis: 38px;
  }

  .logo img {
    width: 22px;
    height: 22px;
  }
}

@media (max-width: 420px) {
  .logo {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    flex-basis: 34px;
  }

  .logo img {
    width: 19px;
    height: 19px;
  }
}

/* =========================================================
   CARDS
   ========================================================= */

.card{
  padding:18px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.025),transparent);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow:var(--shadow);
}

:root[data-theme="light"] .card{
  background:linear-gradient(180deg,var(--card),#f5fcfc);
  border-color:var(--border);
  box-shadow:var(--shadow);
}

.card.soft{
  box-shadow:var(--shadow-soft);
}

.card + .card{
  margin-top:14px;
}

.card-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.card-header h1,
.card-header h2,
.card-header h3{
  margin:0;
}

.card-header .muted{
  margin-top:5px;
}

.card-footer{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--line);
}

/* =========================================================
   TYPOGRAPHY
   ========================================================= */

.title{
  margin:0;
  font-size:28px;
  line-height:1.15;
  font-weight:800;
  letter-spacing:-.025em;
}

.subtitle{
  margin:7px 0 0;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

h1,
h2,
h3,
h4{
  color:inherit;
}

h1{
  font-size:30px;
  line-height:1.15;
}

h2{
  font-size:21px;
}

h3{
  font-size:16px;
}

p{
  line-height:1.6;
}

.muted{
  color:var(--muted);
}

.muted-2{
  color:var(--muted-2);
}

.small{
  font-size:12px;
}

.tiny{
  font-size:11px;
}

strong{
  font-weight:800;
}

/* =========================================================
   FORMS
   ========================================================= */

.grid{
  display:grid;
  gap:12px;
}

.split{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.form{
  display:grid;
  gap:14px;
}

.form-row{
  display:grid;
  gap:7px;
}

label{
  display:grid;
  gap:7px;
  color:var(--muted);
  font-size:13px;
  font-weight:500;
}

label .hint{
  color:var(--muted-2);
  font-size:12px;
}

input,
select,
textarea{
  width:100%;
  border:1px solid var(--border);
  outline:0;
  background:rgba(255,255,255,.025);
  color:var(--text);
  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease,
    transform .1s ease;
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea{
  background:#fff;
}

input,
select{
  min-height:46px;
  padding:11px 13px;
}

textarea{
  min-height:120px;
  padding:12px 13px;
  resize:vertical;
}

input::placeholder,
textarea::placeholder{
  color:var(--muted-2);
}

input:hover,
select:hover,
textarea:hover{
  border-color:rgba(51,214,223,.28);
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--accent);
  box-shadow:
    0 0 0 3px var(--focus-glow),
    0 8px 20px rgba(0,0,0,.12);
  background:rgba(255,255,255,.045);
}

:root[data-theme="light"] input:focus,
:root[data-theme="light"] select:focus,
:root[data-theme="light"] textarea:focus{
  background:#fff;
}

input:disabled,
select:disabled,
textarea:disabled{
  opacity:.6;
  cursor:not-allowed;
}

input[type="checkbox"],
input[type="radio"]{
  width:18px;
  min-width:18px;
  height:18px;
  min-height:18px;
  padding:0;
  accent-color:var(--accent);
  box-shadow:none;
}

.check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.check input{
  margin-top:1px;
  flex:0 0 18px;
}

.field-error{
  color:#ff9faf;
  font-size:12px;
  line-height:1.4;
}

.field-success{
  color:#93ebbd;
  font-size:12px;
  line-height:1.4;
}

/* =========================================================
   BUTTONS
   ========================================================= */

button,
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:9px 14px;
  border:0;
  border-radius:999px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
  cursor:pointer;
  transition:
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    transform .1s ease,
    opacity .2s ease;
}

button:active,
.btn:active{
  transform:scale(.96);
}

a.btn{
  text-decoration:none;
  color:inherit;
}

.btn-primary,
button:not(.secondary):not(.danger):not(.ghost):not(.link-button){
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  color:#042727;
  box-shadow:0 6px 18px rgba(51,214,223,.16);
}

.btn-primary:hover,
button:not(.secondary):not(.danger):not(.ghost):not(.link-button):hover{
  filter:brightness(1.05);
  box-shadow:0 8px 22px rgba(51,214,223,.22);
}

:root[data-theme="light"] .btn-primary,
:root[data-theme="light"] button:not(.secondary):not(.danger):not(.ghost):not(.link-button){
  color:#fff;
  background:var(--accent);
  box-shadow:0 4px 14px rgba(0,104,110,.2);
}

.btn-secondary,
button.secondary{
  background:rgba(255,255,255,.04);
  color:var(--text);
  border:1px solid var(--border);
}

.btn-secondary:hover,
button.secondary:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(51,214,223,.25);
}

:root[data-theme="light"] .btn-secondary,
:root[data-theme="light"] button.secondary{
  background:#fff;
  color:var(--text);
}

:root[data-theme="light"] .btn-secondary:hover,
:root[data-theme="light"] button.secondary:hover{
  background:#f3f8f7;
}

.btn-danger,
button.danger{
  background:var(--danger-bg);
  color:#ffc3cc;
  border:1px solid rgba(255,107,115,.24);
}

.btn-danger:hover,
button.danger:hover{
  border-color:var(--danger);
  background:rgba(255,107,115,.12);
}

:root[data-theme="light"] .btn-danger,
:root[data-theme="light"] button.danger{
  color:#9c3249;
  border-color:#efc3cd;
}

.btn-ghost,
button.ghost{
  background:transparent;
  color:var(--muted);
  border:1px solid transparent;
}

.btn-ghost:hover,
button.ghost:hover{
  background:var(--glass);
  color:var(--text);
  border-color:var(--border);
}

.link-button{
  min-height:auto;
  padding:0;
  border:0;
  background:transparent;
  color:var(--accent);
  font-weight:700;
}

.link-button:hover{
  color:var(--accent-2);
  text-decoration:underline;
}

.btn-block{
  width:100%;
}

.actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.actions-right{
  justify-content:flex-end;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.nav{
  display:flex;
  align-items:center;
  gap:6px;
  margin:0 0 18px;
  flex-wrap:wrap;
}

.nav a,
.nav button{
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  font-size:12px;
}

.nav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,255,255,.04);
  color:var(--muted);
  border:1px solid var(--border);
  text-decoration:none;
}

.nav a:hover{
  background:rgba(255,255,255,.07);
  color:var(--text);
}

.nav a.active{
  color:#042727;
  background:linear-gradient(90deg,var(--accent),var(--accent-2));
  border-color:transparent;
}

:root[data-theme="light"] .nav a.active{
  color:#fff;
}

/* =========================================================
   AUTH HERO
   ========================================================= */

.auth-hero{
  margin-bottom:16px;
}

.auth-hero .eyebrow{
  margin-bottom:7px;
  color:var(--accent);
  font-size:11px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.auth-hero h1{
  margin:0;
  font-size:30px;
  font-weight:800;
  letter-spacing:-.025em;
}

.auth-hero p{
  margin:8px 0 0;
  color:var(--muted);
  font-size:14px;
}

/* =========================================================
   MESSAGES
   ========================================================= */

.msg{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:11px 13px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.025);
  font-size:13px;
  line-height:1.5;
}

.msg::before{
  content:"";
  width:8px;
  height:8px;
  margin-top:5px;
  flex:0 0 8px;
  border-radius:50%;
  background:var(--muted-2);
}

.msg.ok{
  background:var(--success-bg);
  border-color:rgba(123,228,149,.2);
  color:#baf0d2;
}

.msg.ok::before{
  background:var(--success);
}

.msg.error{
  background:var(--danger-bg);
  border-color:rgba(255,107,115,.2);
  color:#ffc7d0;
}

.msg.error::before{
  background:var(--danger);
}

.msg.warning{
  background:var(--warning-bg);
  border-color:rgba(255,209,102,.2);
  color:#f5d58d;
}

.msg.warning::before{
  background:var(--warning);
}

.msg.info{
  background:rgba(51,214,223,.06);
  border-color:rgba(51,214,223,.16);
  color:#c7f5f7;
}

.msg.info::before{
  background:var(--accent);
}

:root[data-theme="light"] .msg.ok{
  color:#267b50;
  border-color:#c7e8d5;
}

:root[data-theme="light"] .msg.error{
  color:#9c3249;
  border-color:#efc3cd;
}

:root[data-theme="light"] .msg.info{
  color:#17656a;
  background:#eef9f9;
  border-color:#cfe9ea;
}

.toast{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:5000;
  width:min(380px,calc(100% - 40px));
  opacity:0;
  transform:translateY(12px);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

/* =========================================================
   LOADING
   ========================================================= */

.loading{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.spinner{
  width:15px;
  height:15px;
  border:2px solid rgba(4,39,39,.18);
  border-top-color:currentColor;
  border-radius:50%;
  animation:spin .7s linear infinite;
}

.btn-secondary .spinner,
.btn-danger .spinner,
.btn-ghost .spinner{
  border-color:rgba(255,255,255,.14);
  border-top-color:currentColor;
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

/* =========================================================
   ACCOUNT
   ========================================================= */

.account-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:18px;
}

.account-user{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.avatar{
  width:50px;
  height:50px;
  min-width:50px;
  min-height:50px;
  display:grid;
  place-items:center;
  flex:0 0 50px;
  aspect-ratio:1;
  border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#042727;
  font-size:18px;
  font-weight:900;
  box-shadow:0 6px 18px rgba(51,214,223,.12);
}

.account-user h1,
.account-user h2{
  margin:0;
}

.account-user p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.stat-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.stat{
  padding:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.025);
}

:root[data-theme="light"] .stat{
  background:rgba(2,20,20,.02);
}

.stat-label{
  display:block;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
}

.stat-value{
  display:block;
  margin-top:6px;
  color:var(--text);
  font-size:16px;
  font-weight:800;
}

/* =========================================================
   SETTINGS
   ========================================================= */

.setting-group{
  display:grid;
  gap:0;
}

.setting{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:14px 0;
  border-bottom:1px solid var(--border);
}

.setting:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.setting:first-child{
  padding-top:0;
}

.setting-copy{
  min-width:0;
}

.setting-copy strong{
  display:block;
  font-size:14px;
  font-weight:800;
}

.setting-copy span{
  display:block;
  margin-top:4px;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}

/* =========================================================
   DEVICES
   ========================================================= */

.device{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:15px 0;
  border-bottom:1px solid var(--border);
}

.device:first-child{
  padding-top:0;
}

.device:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.device-main{
  min-width:0;
}

.device-header{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.device h4{
  margin:0;
  font-size:14px;
  font-weight:800;
}

.device p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.55;
}

.device-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
  flex:0 0 auto;
}

.device-icon{
  width:42px;
  height:42px;
  min-width:42px;
  display:grid;
  place-items:center;
  flex:0 0 42px;
  border-radius:13px;
  background:rgba(51,214,223,.055);
  border:1px solid rgba(51,214,223,.12);
  color:var(--accent);
}

.device-row{
  display:flex;
  align-items:flex-start;
  gap:11px;
}

/* =========================================================
   PILLS / BADGES
   ========================================================= */

.pill{
  display:inline-flex;
  align-items:center;
  gap:5px;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
  color:var(--muted);
  border:1px solid var(--border);
  font-size:11px;
  line-height:1;
  white-space:nowrap;
}

.pill.success{
  background:rgba(123,228,149,.08);
  border-color:rgba(123,228,149,.18);
  color:#a8e6c3;
}

.pill.danger{
  background:rgba(255,107,115,.08);
  border-color:rgba(255,107,115,.18);
  color:#ffc3cc;
}

.pill.warning{
  background:rgba(255,209,102,.08);
  border-color:rgba(255,209,102,.18);
  color:#f4d48a;
}

.pill.neutral{
  color:var(--muted);
}

/* =========================================================
   ACTIVITY
   ========================================================= */

.activity-list{
  display:grid;
}

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

.activity:first-child{
  padding-top:0;
}

.activity:last-child{
  border-bottom:0;
  padding-bottom:0;
}

.activity-copy{
  min-width:0;
}

.activity-title{
  margin:0;
  font-size:14px;
  font-weight:800;
}

.activity-meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-top:5px;
  color:var(--muted);
  font-size:12px;
}

.activity-time{
  flex:0 0 auto;
  color:var(--muted-2);
  font-size:11px;
  white-space:nowrap;
}

/* =========================================================
   EMPTY
   ========================================================= */

.empty{
  padding:28px 18px;
  text-align:center;
  border:1px dashed rgba(255,255,255,.12);
  border-radius:16px;
  color:var(--muted);
  background:rgba(255,255,255,.018);
}

:root[data-theme="light"] .empty{
  border-color:rgba(2,20,20,.12);
  background:rgba(2,20,20,.015);
}

.empty strong{
  display:block;
  margin-bottom:5px;
  color:inherit;
}

.empty p{
  margin:0;
  font-size:13px;
}

/* =========================================================
   DIVIDERS / UTILITIES
   ========================================================= */

.divider{
  height:1px;
  margin:18px 0;
  background:linear-gradient(90deg,transparent,var(--border),transparent);
}

.row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.row-start{
  align-items:flex-start;
}

.stack{
  display:grid;
  gap:9px;
}

.spacer{
  flex:1;
}

.hidden{
  display:none!important;
}

.w-full{
  width:100%;
}

.text-center{
  text-align:center;
}

/* =========================================================
   THEME SWITCH
   ========================================================= */

.theme-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  color:var(--muted);
  cursor:pointer;
  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .1s ease;
}

.theme-toggle:hover{
  color:var(--text);
  background:rgba(255,255,255,.07);
  border-color:rgba(51,214,223,.2);
}

.theme-toggle:active{
  transform:scale(.96);
}

:root[data-theme="light"] .theme-toggle{
  background:#fff;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer{
  padding:18px 0 4px;
  color:var(--muted-2);
  font-size:12px;
  text-align:center;
}

footer a{
  color:inherit;
  text-decoration:none;
}

footer a:hover{
  color:var(--accent);
}

/* =========================================================
   THEME TOGGLE (top-right of auth pages)
   ========================================================= */

.theme-toggle-auth{
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 600;

  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;

  margin: 0;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--border);
  border-radius: 999px;

  background: rgba(255, 255, 255, .04);
  color: var(--muted);

  cursor: pointer;

  transition:
    background .2s ease,
    border-color .2s ease,
    color .2s ease,
    transform .1s ease;
}

.theme-toggle-auth:hover{
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  border-color: rgba(51, 214, 223, .2);
}

.theme-toggle-auth:active{
  transform: scale(.95);
}

.theme-toggle-auth svg{
  display: block;
}

:root[data-theme="light"] .theme-toggle-auth{
  background: #fff;
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}

@media (prefers-reduced-motion:reduce){
  *,
  *::before,
  *::after{
    scroll-behavior:auto!important;
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
  }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width:900px){
  .shell{
    padding:28px 0 24px;
  }

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

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:640px){
  .shell{
    width:min(calc(100% - 16px),560px);
    padding:18px 0 16px;
  }

  .brand{
    gap:9px;
    margin-bottom:14px;
  }

  .logo{
    width:38px;
    height:38px;
    min-width:38px;
    min-height:38px;
    flex-basis:38px;
  }

  .logo img{
    width:22px;
    height:22px;
  }

  .brand-copy strong{
    max-width:190px;
    font-size:13px;
  }

  .brand-copy span{
    font-size:11px;
  }

  .card{
    padding:14px;
    border-radius:16px;
  }

  .title{
    font-size:24px;
  }

  .auth-hero h1{
    font-size:25px;
  }

  .split{
    grid-template-columns:1fr;
  }

  .stat-grid{
    grid-template-columns:1fr 1fr;
    gap:9px;
  }

  .account-header{
    flex-direction:column;
  }

  .setting{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }

  .device{
    flex-direction:column;
  }

  .device-actions{
    width:100%;
    justify-content:flex-start;
  }

  .activity{
    flex-direction:column;
    gap:8px;
  }

  .activity-time{
    align-self:flex-start;
  }

  .actions{
    width:100%;
  }

  .actions > button,
  .actions > .btn{
    flex:1 1 auto;
  }
}

/* =========================================================
   SMALL PHONES
   ========================================================= */

@media (max-width:420px){
  .shell{
    width:calc(100% - 12px);
    padding:12px 0;
  }

  .card{
    padding:12px;
    border-radius:14px;
  }

  .logo{
    width:34px;
    height:34px;
    min-width:34px;
    min-height:34px;
    flex-basis:34px;
  }

  .logo img{
    width:19px;
    height:19px;
  }

  .brand-copy strong{
    max-width:150px;
    font-size:12px;
  }

  .brand-copy span{
    font-size:10px;
  }

  .title{
    font-size:22px;
  }

  .auth-hero h1{
    font-size:23px;
  }

  .stat-grid{
    grid-template-columns:1fr;
  }

  input,
  select{
    min-height:44px;
  }

  button,
  .btn{
    min-height:42px;
  }

  .nav{
    gap:5px;
  }

  .nav a,
  .nav button{
    flex:1 1 auto;
    min-height:36px;
    padding:8px 10px;
  }
}

/* =========================================================
   PASSWORD FIELDS
   ========================================================= */

.password-wrap {
  position: relative;
  width: 100%;
}

.password-wrap input {
  width: 100%;
  padding-right: 50px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 5;

  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;

  margin: 0;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 999px;

  background: transparent !important;
  color: var(--text) !important;

  box-shadow: none !important;
  cursor: pointer;

  opacity: 0.92;
  transform: translateY(-50%);

  transition:
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease,
    transform 0.1s ease;
}

.password-toggle:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
  opacity: 1;
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.94);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.password-toggle svg {
  display: block;
  width: 22px;
  height: 22px;

  min-width: 22px;
  min-height: 22px;

  max-width: none;
  max-height: none;

  color: inherit;
  pointer-events: none;
}

.password-toggle .password-slash[hidden] {
  display: none !important;
}

/* =========================================================
   AUTH — MODERN LAYOUT (login / register)
   Aurora фон, стъклен панел и градиентни акценти; само CSS —
   HTML структурата и data-i18n атрибутите остават непокътнати.
   ========================================================= */

.auth-center{
  position:relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:40px 18px 28px;
}

/* Aurora: меки плаващи радиални акценти + фин дътов grid */
.auth-center::before,
.auth-center::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  pointer-events:none;
}

.auth-center::before{
  background:
    radial-gradient(720px 480px at 12% 8%, rgba(51,214,223,.16), transparent 62%),
    radial-gradient(820px 560px at 92% 16%, rgba(123,228,149,.10), transparent 60%);
  filter:blur(42px);
  animation:auth-aurora 26s ease-in-out infinite alternate;
}

.auth-center::after{
  background:
    radial-gradient(640px 420px at 78% 92%, rgba(51,214,223,.10), transparent 60%),
    radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.5px);
  background-size:auto, 26px 26px;
  opacity:.5;
}

:root[data-theme="light"] .auth-center::before{
  background:
    radial-gradient(720px 480px at 12% 8%, rgba(0,104,110,.10), transparent 62%),
    radial-gradient(820px 560px at 92% 16%, rgba(9,116,74,.08), transparent 60%);
  opacity:.6;
}

:root[data-theme="light"] .auth-center::after{
  background:
    radial-gradient(640px 420px at 78% 92%, rgba(0,104,110,.06), transparent 60%),
    radial-gradient(rgba(2,20,20,.05) 1px, transparent 1.5px);
  background-size:auto, 26px 26px;
  opacity:.35;
}

@keyframes auth-aurora{
  from{
    transform:translate3d(-2%,-1%,0) scale(1);
  }

  to{
    transform:translate3d(2%,2%,0) scale(1.06);
  }
}

.auth-brand{
  margin:0 0 10px;
}

.auth-brand .logo{
  border-radius:14px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#04262b;
  box-shadow:0 8px 24px rgba(51,214,223,.35);
}

.auth-panel-card{
  width:min(460px,100%);
  padding:38px 34px 30px;
  border-radius:24px;
  background:linear-gradient(180deg,rgba(255,255,255,.07),rgba(255,255,255,.02));
  border:1px solid rgba(255,255,255,.10);
  box-shadow:
    0 30px 70px rgba(2,6,12,.5),
    inset 0 1px 0 rgba(255,255,255,.10);
  backdrop-filter:blur(20px) saturate(150%);
  -webkit-backdrop-filter:blur(20px) saturate(150%);
  animation:auth-card-in .45s ease both;
}

:root[data-theme="light"] .auth-panel-card{
  background:linear-gradient(180deg,rgba(255,255,255,.9),rgba(255,255,255,.72));
  border-color:rgba(2,20,20,.08);
  box-shadow:
    0 24px 60px rgba(2,30,34,.14),
    inset 0 1px 0 rgba(255,255,255,.9);
}

@keyframes auth-card-in{
  from{
    opacity:0;
    transform:translateY(10px);
  }

  to{
    opacity:1;
    transform:none;
  }
}

.auth-title{
  margin:0;
  font-size:clamp(24px,4vw,30px);
  font-weight:800;
  letter-spacing:-.02em;
  background:linear-gradient(120deg,var(--text) 35%,var(--accent) 65%,var(--accent-2) 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.auth-subtitle{
  margin:8px 0 0;
  color:var(--muted);
  font-size:15px;
}

.auth-form{
  margin-top:26px;
  gap:14px;
}

.auth-form label span{
  font-weight:600;
  font-size:13px;
  letter-spacing:.01em;
}

.auth-form input{
  min-height:50px;
  padding:13px 16px;
  border-radius:14px;
  background:var(--glass);
  border:1px solid var(--border);
}

.auth-form input:hover{
  border-color:rgba(51,214,223,.35);
}

.auth-form input:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 4px var(--focus-glow);
}

.registration-legal{
  min-width:0;
  padding:16px;
  border:1px solid var(--border);
  border-radius:14px;
  background:rgba(255,255,255,.025);
}

.registration-legal h2{
  margin:0 0 12px;
  color:var(--text);
  font-size:14px;
  font-weight:750;
}

.registration-legal-copy{
  max-height:290px;
  overflow:auto;
  padding-right:8px;
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
  scrollbar-color:var(--muted-2) transparent;
}

.registration-legal-copy h3{
  margin:16px 0 6px;
  color:var(--text);
  font-size:12px;
  line-height:1.5;
}

.registration-legal-copy h3:first-child{
  margin-top:0;
}

.registration-legal-copy p{
  margin:0 0 9px;
}

.registration-legal-copy ul{
  margin:0 0 10px;
  padding-left:18px;
}

.registration-legal-copy li{
  margin:0 0 6px;
}

.registration-legal-copy a,
.registration-consent a{
  color:var(--accent);
  font-weight:700;
  text-underline-offset:2px;
}

.registration-legal-copy a:hover,
.registration-consent a:hover{
  color:var(--accent-2);
}

.registration-consents{
  display:grid;
  gap:11px;
  min-width:0;
  margin:0;
  padding:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--glass);
}

.registration-consents legend{
  padding:0 6px;
  color:var(--text);
  font-size:13px;
  font-weight:750;
}

.auth-form .registration-consent{
  display:flex;
  align-items:flex-start;
  gap:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.55;
  cursor:pointer;
}

.auth-form .registration-consent input{
  width:18px;
  min-width:18px;
  height:18px;
  min-height:18px;
  margin:1px 0 0;
  padding:0;
  flex:0 0 18px;
  accent-color:var(--accent);
}

.auth-form .registration-consent span{
  font-size:12px;
  font-weight:500;
  letter-spacing:0;
}

.registration-consents .hint{
  margin-top:0;
}

.auth-form .password-wrap input{
  padding-right:52px;
}

.auth-form .btn-block{
  min-height:52px;
  margin-top:6px;
  padding:14px 18px;
  border-radius:14px;
  font-weight:800;
  font-size:15px;
  letter-spacing:.01em;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#04262b;
  box-shadow:
    0 10px 26px rgba(51,214,223,.30),
    inset 0 1px 0 rgba(255,255,255,.25);
  transition:
    transform .15s ease,
    box-shadow .2s ease,
    filter .2s ease;
}

.auth-form .btn-block:hover{
  transform:translateY(-1px);
  filter:brightness(105%) saturate(115%);
  box-shadow:
    0 14px 32px rgba(51,214,223,.38),
    inset 0 1px 0 rgba(255,255,255,.25);
}

.auth-form .btn-block:active{
  transform:translateY(0) scale(.99);
}

.auth-form .btn-block:disabled{
  filter:grayscale(.3);
  opacity:.6;
}

:root[data-theme="light"] .auth-form .btn-block{
  color:#fff;
  box-shadow:0 10px 26px rgba(0,104,110,.25), inset 0 1px 0 rgba(255,255,255,.2);
}

.auth-links{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  margin-top:2px;
  font-size:13px;
}

.auth-links-sep{
  color:var(--muted-2);
}

.auth-switch{
  margin:0;
  text-align:center;
  font-size:14px;
}

.auth-switch .link{
  font-weight:700;
}

.auth-foot{
  padding:12px 0 0;
  margin:0;
  text-align:center;
  color:var(--muted-2);
  font-size:12px;
}

.msg{
  margin-bottom:16px;
}

#message:empty{
  display:none;
  margin:0;
}

@media (max-width:640px){
  .auth-center{
    padding:26px 12px 20px;
    gap:6px;
  }

  .auth-panel-card{
    padding:28px 20px 22px;
  }

  .auth-form input{
    min-height:48px;
  }
}

@media (max-width:420px){
  .theme-toggle-auth{
    top:12px;
    right:12px;
  }
}

@media (prefers-reduced-motion:reduce){
  .auth-center::before{
    animation:none;
  }

  .auth-panel-card{
    animation:none;
  }
}

#passwordMatch {
  display: block;
  min-height: 18px;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}

#passwordMatch:not(:empty) {
  color: var(--muted);
}

#passwordMatch.password-match-error {
  color: var(--danger);
}

#passwordMatch.password-match-ok {
  color: var(--success);
}

:root[data-theme="light"] .password-toggle {
  color: #3f5561 !important;
}

:root[data-theme="light"] .password-toggle:hover {
  background: var(--accent-soft) !important;
  color: var(--accent) !important;
}