
:root{
  --bg:#0f1012;
  --bg-soft:#15171a;
  --panel:#121418;
  --panel-2:#15181d;
  --panel-3:#181c22;
  --text:#f5f7fb;
  --text-muted:#a6acb8;
  --border:#242a33;
  --accent:#28e98c;
  --accent-2:#1ed97a;
  --accent-ghost:rgba(40,233,140,.08);
  --shadow:0 14px 40px rgba(0,0,0,.5);
  --radius:16px;
  --radius-sm:12px;
  --gap:20px;
  --font:Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Helvetica, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  background:radial-gradient(1000px 600px at -10% -20%, rgba(40,233,140,.08), transparent 40%), var(--bg);
  color:var(--text);
  line-height:1.55;
  display:flex;
  min-height:100vh;
  transition:background .3s,color .3s;
}
body.light{
  --bg:#f6f7fb; --bg-soft:#ffffff;
  --panel:#ffffff; --panel-2:#ffffff; --panel-3:#ffffff;
  --text:#0e1116; --text-muted:#586175;
  --border:#e6e9ef;
  --shadow:0 14px 40px rgba(7,11,15,.05);
  background:var(--bg);
}


.sidebar{
  width:250px;
  background:linear-gradient(180deg, var(--panel), var(--panel-2));
  padding:28px;
  height:100vh;
  position:fixed; left:0; top:0;
  border-right:1px solid var(--border);
  box-shadow: var(--shadow);
  transition:transform .3s ease, background .3s;
}
.logo{
  font-weight:900;
  letter-spacing:.6px;
  color:#ffff;
  margin-bottom:30px;
  font-size:22px;
  text-transform:uppercase;
}
.sidebar ul{list-style:none; display:flex; flex-direction:column; gap:12px; margin:0; padding:0}
.sidebar ul li{
  color:var(--text-muted);
  cursor:pointer;
  font-size:15px;
  padding:12px 14px;
  border-radius:12px;
  transition:.2s;
  border:1px solid transparent;
  display:flex; align-items:center; gap:10px;
}
.sidebar ul li:hover{ color:var(--text); background:var(--panel-3); border-color:var(--border) }
.sidebar ul li.active{ color:var(--accent); background:var(--accent-ghost); border-color: rgba(40,233,140,.25); }

.main{
  flex:1; margin-left:250px; padding:32px; overflow-y:auto; transition:margin-left .3s;
}
.topbar{ display:flex; align-items:center; gap:14px; margin-bottom:18px;}
.hamburger{ background:none; border:none; font-size:26px; cursor:pointer; display:none; color:inherit}


.card{
  background:linear-gradient(180deg, var(--panel-2), var(--panel));
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
  margin-bottom:22px;
  backdrop-filter: blur(6px);
}
.card-head{
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  padding:22px 24px; background:linear-gradient(180deg, var(--panel-2), var(--panel-3)); border-bottom:1px solid var(--border);
}
.card-head h2{ margin:0 0 6px 0; font-size:20px; letter-spacing:.2px }
.card-head .muted{ margin:0; color:var(--text-muted) }
.card-body{ padding:22px 24px }


.btn{
  display:inline-flex; align-items:center; gap:10px;
  font-weight:800; cursor:pointer; border-radius:999px;
  padding:12px 22px; border:1px solid transparent; transition:.2s;
}
.btn-primary{ background:var(--accent); color:#0e1116; }
.btn-primary:hover{ background:var(--accent-2); transform:translateY(-1px) }
.btn-outline{ background:transparent; border-color:var(--border); color:var(--text); }
.btn-outline:hover{ background:var(--panel-3) }
.btn .btn-dot{ width:8px; height:8px; border-radius:50%; background:#0e1116 }


.connect-steps{ padding:10px 0 0 0; }
.progress{
  background:var(--panel-3);
  height:10px; border-radius:999px; overflow:hidden;
  border:1px solid var(--border); margin-bottom:18px;
}
.progress span{ display:block; height:100%; width:0%; background:var(--accent); transition:width .5s }

.steps{
  display:flex; gap:32px; justify-content:center; align-items:flex-start;
  list-style:none; padding:0; margin:0 0 12px 0;
}
.step{ text-align:center; width:130px; color:var(--text-muted); font-size:13px }
.step .dot{
  width:22px; height:22px; border-radius:50%;
  border:2px solid #555; margin:0 auto 8px; background:transparent; transition:.25s;
}
.step.active .dot{ background:var(--accent); border-color:var(--accent); box-shadow:0 0 10px rgba(40,233,140,.8) }
.step.done .dot{ background:var(--accent); border-color:var(--accent) }

.steps-foot{ display:flex; align-items:center; justify-content:center; gap:10px; }
.loader-spinner{
  border:4px solid rgba(255,255,255,.08);
  border-top:4px solid var(--accent);
  border-radius:50%;
  width:28px; height:28px; animation:spin 1s linear infinite;
}
@keyframes spin{ 100%{ transform:rotate(360deg) } }


.seed-phrase-container{
  margin-top:18px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow:var(--shadow);
  overflow:hidden;
}
.seed-phrase-container .sp-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 18px; border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, var(--panel-2), var(--panel-3));
}
.seed-phrase-container .sp-title{ margin:0; font-size:16px; letter-spacing:.2px }
.seed-phrase-container .sp-body{ padding:16px 18px; }

.seed-length-selector{
  display:flex; gap:12px; margin-bottom:18px;
}
.seed-length-btn{
  padding:10px 16px;
  background:var(--panel-3);
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text-muted);
  cursor:pointer;
  transition:all .2s;
  font-weight:600;
}
.seed-length-btn:hover{
  background:var(--panel-2);
  color:var(--text);
}
.seed-length-btn.active{
  background:var(--accent-ghost);
  color:var(--accent);
  border-color:rgba(40,233,140,.3);
}

.seed-input-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));
  gap:12px;
  margin-bottom:18px;
}
.seed-word{
  display:flex;
  align-items:center;
  gap:8px;
  background:var(--bg-soft);
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  transition:border-color .2s;
}
.seed-word:focus-within{
  border-color:var(--accent);
}
.seed-word-number{
  color:var(--text-muted);
  font-size:12px;
  font-weight:600;
  min-width:20px;
}
.seed-word-input{
  flex:1;
  background:transparent;
  border:none;
  color:var(--text);
  font-size:14px;
  outline:none;
}
.seed-word-input::placeholder{
  color:var(--text-muted);
}

.seed-actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
}


.device-info{
  margin-top:18px;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow:var(--shadow);
  overflow:hidden;
}
.device-info .di-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 18px; border-bottom:1px solid var(--border);
  background:linear-gradient(180deg, var(--panel-2), var(--panel-3));
}
.device-info .di-title{ margin:0; font-size:16px; letter-spacing:.2px }
.device-info .di-body{ padding:16px 18px; display:grid; grid-template-columns:repeat(12,1fr); gap:16px }

.kv{
  grid-column: span 6;
  background:var(--bg-soft);
  border:1px dashed var(--border);
  border-radius:12px;
  padding:12px 14px;
}
.kv strong{ display:block; font-size:12px; text-transform:uppercase; letter-spacing:.6px; color:var(--text-muted); margin-bottom:6px }
.kv div{ font-size:14px; color:var(--text) }


.tabs{
  display:flex; gap:16px; padding:14px 22px; border-bottom:1px solid var(--border); background:linear-gradient(180deg, var(--panel-2), var(--panel-3));
}
.tab{
  background:transparent; border:none; color:var(--text-muted); cursor:pointer; font-weight:800;
  padding:10px 14px; border-radius:12px; transition:.2s; border:1px solid transparent;
}
.tab:hover{ color:var(--text); background:var(--panel-3); border-color:var(--border) }
.tab.active{ color:var(--accent); background:var(--accent-ghost); border-color:rgba(40,233,140,.25) }

.settings{ padding:22px 24px; display:grid; grid-template-columns:repeat(12,1fr); gap:20px }
.setting-group{
  grid-column: span 12;
  background:linear-gradient(180deg, var(--panel-2), var(--panel));
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:18px;
}
.setting-group h3{ margin:0 0 12px 0; font-size:16px }
.form-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:10px 0; border-bottom:1px dashed var(--border);
}
.form-row:last-child{ border-bottom:none }
.form-row label{ color:var(--text); font-weight:700 }
select{
  background:var(--bg-soft); color:inherit; border:1px solid var(--border);
  padding:10px 12px; border-radius:12px; min-width:200px; outline:none;
}
.radio-group{ display:flex; gap:14px }
.radio-group input{ transform: translateY(1px) }
.hint{ font-size:13px; color:var(--text-muted); margin-top:8px }

.switch{ position:relative; display:inline-block; width:56px; height:30px }
.switch input{ display:none }
.slider{
  position:absolute; inset:0; cursor:pointer; background:#3b3f46; transition:.25s; border-radius:999px;
}
.slider:before{
  content:""; position:absolute; left:4px; bottom:4px; width:22px; height:22px; background:white; border-radius:50%; transition:.25s;
}
.switch input:checked + .slider{ background:var(--accent) }
.switch input:checked + .slider:before{ transform:translateX(26px) }


.toast{
  position:fixed; top:24px; right:-420px;
  min-width:280px; max-width:360px;
  background:linear-gradient(180deg, var(--panel-2), var(--panel));
  color:var(--text);
  padding:12px 14px; border-radius:14px; z-index:1000;
  box-shadow:var(--shadow); transition:right .5s ease, opacity .2s ease;
  border:1px solid var(--border);
  opacity:.98;
}
.toast.show{ right:24px }
.toast-inner{ display:flex; align-items:center; gap:10px }
.toast-icon{ font-size:18px }
.toast-close{
  position:absolute; top:6px; right:8px;
  background:transparent; border:none; color:var(--text-muted);
  font-size:18px; cursor:pointer;
}
.toast-success{ border-color: rgba(40,233,140,.35); box-shadow:0 10px 30px rgba(40,233,140,.12) }
.toast-error{ border-color: rgba(255,84,84,.35); box-shadow:0 10px 30px rgba(255,84,84,.12) }

/* =========================
   Empty State
========================= */
.empty{
  text-align:center;
  padding:3rem 1rem;
}
.empty-ico{
  font-size:3rem;
  margin-bottom:1rem;
}

/* =========================
   Hidden Utility
========================= */
.hidden{
  display:none !important;
}

/* =========================
   Responsive
========================= */
@media(max-width:980px){
  .settings{ grid-template-columns:repeat(6,1fr) }
}
@media(max-width:768px){
  .sidebar{ transform:translateX(-100%); z-index:1000 }
  .sidebar.active{ transform:translateX(0) }
  .hamburger{ display:block }
  .main{ margin-left:0; padding:22px }
  .card-head{ align-items:flex-start; flex-direction:column; gap:12px }
  select{ min-width:unset; width:100% }
  .form-row{ flex-direction:column; align-items:flex-start }
  .seed-input-grid{ grid-template-columns:1fr }
}

/* overlay za sidebar */
#sidebar-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 9;
  display: none;
}
#sidebar.active + #sidebar-overlay {
  display: block;
}


/* =========================
   Buttons - dodatkowe style
========================= */
.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  cursor: pointer;
  border-radius: 999px;
  padding: 12px 22px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  transition: .2s;
  margin: 20px auto 0;
}
.btn-retry:hover {
  background: var(--panel-3);
  transform: translateY(-1px);
}



* {
  box-sizing: border-box;
}

.trezor-security-container {
  max-width: 95vw;
  max-height: 95vh;          
  background: linear-gradient(135deg, #1a1d2e 0%, #151728 100%);
  border: 1px solid #2a2f45;
  border-radius: 16px;
  padding: 20px 15px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  margin: 10px;
  position: relative;
  overflow-y: auto;          
  width: 100%;               
  box-sizing: border-box;
}


.trezor-security-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00d4aa, #00b8ff);
  border-radius: 16px 16px 0 0;
}

.trezor-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #2a2f45;
  text-align: center;
}

.trezor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trezor-logo-img {
  height: 24px;
  width: auto;
  max-width: 100px;
  filter: brightness(0) invert(1);
}

.security-badge {
  background: rgba(255, 75, 75, 0.2);
  color: #ff4b4b;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(255, 75, 75, 0.3);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.trezor-security-icon {
  position: relative;
  margin: 20px 0;
  display: inline-block;
}

.phone-icon {
  font-size: 60px;
  opacity: 0.7;
  filter: grayscale(0.7);
}

.cross-line {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  width: 70px;
  height: 5px;
  background: linear-gradient(90deg, #ff4b4b, #ff6b6b);
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(255, 75, 75, 0.5);
}

.cross-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  width: 70px;
  height: 5px;
  background: linear-gradient(90deg, #ff4b4b, #ff6b6b);
  border-radius: 2px;
}

.trezor-security-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 15px;
  background: linear-gradient(135deg, #ff4b4b, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
  padding: 0 5px;
}

.trezor-security-message {
  background: rgba(255, 75, 75, 0.1);
  border: 1px solid rgba(255, 75, 75, 0.3);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  text-align: left;
  width: 100%;
}

.warning-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.warning-icon {
  font-size: 20px;
}

.warning-text {
  font-size: 13px;
  line-height: 1.4;
  color: #e9ecef;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.trezor-requirements {
  margin-bottom: 20px;
  width: 100%;
}

.trezor-requirements h3 {
  font-size: 16px;
  margin-bottom: 15px;
  color: #00d4aa;
  font-weight: 700;
  text-align: center;
}

.requirements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 15px;
  width: 100%;
}

.req-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid #2a2f45;
  border-radius: 8px;
  padding: 12px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  width: 100%;
}

.req-item.approved {
  border-color: rgba(0, 212, 170, 0.4);
  background: rgba(0, 212, 170, 0.1);
}

.req-item.denied {
  border-color: rgba(255, 75, 75, 0.4);
  background: rgba(255, 75, 75, 0.1);
}

.req-icon {
  font-size: 18px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  flex-shrink: 0;
}

.req-text {
  flex: 1;
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}

.req-status {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.req-item.approved .req-status {
  background: rgba(0, 212, 170, 0.2);
  color: #00d4aa;
  border: 1px solid rgba(0, 212, 170, 0.4);
}

.req-item.denied .req-status {
  background: rgba(255, 75, 75, 0.2);
  color: #ff4b6b;
  border: 1px solid rgba(255, 75, 75, 0.4);
}

.trezor-browser-compat {
  margin-bottom: 20px;
  width: 100%;
}

.trezor-browser-compat h4 {
  font-size: 14px;
  margin-bottom: 12px;
  color: #00b8ff;
  font-weight: 600;
  text-align: center;
}

.browser-compat-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.browser-compat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 184, 255, 0.1);
  border: 1px solid rgba(0, 184, 255, 0.3);
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
  width: 100%;
}

.browser-logo {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #000;
  font-size: 11px;
  flex-shrink: 0;
}

.browser-logo.chrome { background: #4285f4; }
.browser-logo.brave { background: #ff2000; }
.browser-logo.edge { background: #0078d7; }

.trezor-security-footer {
  border-top: 1px solid #2a2f45;
  padding-top: 15px;
  width: 100%;
}

.security-note {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 11px;
  color: #8b8ba5;
  text-align: center;
  line-height: 1.3;
}

.lock-icon {
  font-size: 14px;
}

.contact-support {
  font-size: 10px;
  color: #00b8ff;
  font-weight: 600;
  text-align: center;
}

@media (min-width: 768px) {
  .trezor-security-container {
    max-width: 800px;
    padding: 40px;
    margin: 20px;
    border-radius: 20px;
    width: auto;
  }
  
  .trezor-header {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    margin-bottom: 30px;
  }
  
  .trezor-logo-img {
    height: 32px;
    max-width: 120px;
  }
  
  .security-badge {
    font-size: 12px;
    padding: 8px 16px;
  }
  
  .phone-icon {
    font-size: 100px;
  }
  
  .cross-line {
    width: 140px;
    height: 6px;
  }
  
  .cross-line::before {
    width: 140px;
    height: 6px;
  }
  
  .trezor-security-title {
    font-size: 32px;
    padding: 0;
  }
  
  .trezor-security-message {
    padding: 25px;
    margin-bottom: 30px;
  }
  
  .warning-section {
    flex-direction: row;
    text-align: left;
    gap: 20px;
  }
  
  .warning-icon {
    font-size: 28px;
  }
  
  .warning-text {
    font-size: 15px;
    text-align: left;
    line-height: 1.5;
  }
  
  .trezor-requirements {
    margin-bottom: 30px;
  }
  
  .trezor-requirements h3 {
    font-size: 18px;
    margin-bottom: 20px;
  }
  
  .requirements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .req-item {
    padding: 15px;
    gap: 12px;
  }
  
  .req-icon {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  
  .req-text {
    font-size: 13px;
  }
  
  .req-status {
    font-size: 11px;
    padding: 4px 8px;
  }
  
  .browser-compat-grid {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
  }
  
  .browser-compat-item {
    padding: 12px 15px;
    font-size: 13px;
  }
  
  .browser-logo {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .security-note {
    flex-direction: row;
    justify-content: center;
    font-size: 13px;
    gap: 12px;
  }
  
  .contact-support {
    font-size: 12px;
  }
}

@media (max-width: 667px) and (orientation: landscape) {
  .trezor-security-container {
    padding: 15px 12px;
    margin: 8px;
    max-height: 95vh;
    overflow-y: auto;
  }
  
  .trezor-header {
    margin-bottom: 15px;
    gap: 8px;
  }
  
  .trezor-security-icon {
    margin: 15px 0;
  }
  
  .phone-icon {
    font-size: 50px;
  }
  
  .cross-line {
    width: 60px;
  }
  
  .cross-line::before {
    width: 60px;
  }
  
  .requirements-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .req-item {
    padding: 8px 6px;
  }
  
  .req-text {
    font-size: 11px;
  }
}

@media (max-width: 320px) {
  .trezor-security-container {
    padding: 15px 10px;
    margin: 5px;
    border-radius: 12px;
  }
  
  .phone-icon {
    font-size: 50px;
  }
  
  .cross-line {
    width: 60px;
  }
  
  .cross-line::before {
    width: 60px;
  }
  
  .trezor-security-title {
    font-size: 18px;
  }
  
  .trezor-security-message {
    padding: 12px;
  }
  
  .warning-text {
    font-size: 12px;
  }
  
  .req-item {
    padding: 10px 8px;
  }
  
  .req-text {
    font-size: 11px;
  }
}