:root {
  --bg: linear-gradient(20deg,rgb(20 47 71 / 90%) 0%, rgb(81 88 94) 100%);
  --card: rgb(40 40 40 / 31%);
  --primary: rgb(46 144 224);
  --accent: #627c99;
  --border: #80808000;
  --danger: #b1606ed9;
  --text: white;
  --muted: #acacac;
}

html, body {
  box-sizing: border-box;

}
*, *::before, *::after {
  box-sizing: inherit;
}

body {
  background: var(--bg);
  font-family: "Mona Sans", 'Segoe UI', Arial, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  color: var(--text);
}
.container {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-panel, .app-panel, .add-panel {
  background: var(--card);
  padding: 2rem 2.5rem 2.5rem 2.5rem;
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.07);
  min-width: 320px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.login-panel h1 {
  margin-top: 0;
  letter-spacing: 2px;
  color: var(--primary);
  text-align: center;
}

#appName {
  letter-spacing: 1px
}

input[type="text"], 
input[type="password"] {
  padding: .7rem 1rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgb(125 125 125 / 15%);
  transition: border-color 0.2s;
  color: white;
}

input[type="text"]:focus, 
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
}

button {
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0;
  transition: background 0.2s;
}

button:hover:not(#logoutBtn) {
  background: var(--accent);
  color: var(--text);
}

.error {
  color: var(--danger);
  min-height: 1.7em;
  text-align: center;
  font-size: 1rem;
  margin: 0 0 0.6em 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
header h2 {
  margin: 0;
  color: var(--primary);
}
#logoutBtn {
  background: rgb(180, 180, 180);
  font-size: 1rem;
  padding: .5rem .9rem;
  background: none;
  color: var(--muted);
  font-weight: bold;
}

/* Add Form Flex Layout */
#addForm {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: .7em;
  margin-bottom: 1.0em;
  width: 100%;
}
#addForm input {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
  width: 100%;
  background: rgb(125 125 125 / 15%);
}
#addForm button {
  flex: 1;
  white-space: nowrap;
  padding-left: 1.4em;
  padding-right: 1.4em;
  width: auto;
}

#formCancel {
  background-color: var(--danger);
}

/* Reset form within .actions */
.actions {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}
.actions button, .actions form button {
  width: 100%;
  margin-bottom: .6em;
}

.actions form {
  display: flex;
  flex-direction: row;
  gap: .7em;
  margin-top: .5em;
  width: 100%;
}

.actions form input {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
  width: 100%;
}

.actions form button[type="submit"] {
  flex: 0 0 auto;
  max-width: 9em;
  white-space: nowrap;
  padding-left: 1.4em;
  padding-right: 1.4em;
  width: auto;
}

.sites-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .7em;
}

.site-card {
  background: rgb(125 125 125 / 15%);
  border-radius: 9px;
  padding: 1em .8em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 5px #0001;
}

.site-details {
  display: flex;
  flex-direction: column;
}
.site-name {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.5px;
}

.site-password {
  color: var(--primary);
  letter-spacing: 1px;
  font-family: "Mona Sans", 'Segoe UI Mono', 'Menlo', monospace;
  font-size: 1rem;
}

.site-actions {
  display: flex;
  justify-content: end;
  gap: 5px;
}

.site-actions button {
  background: var(--danger);
  font-size: 1rem;
  padding: .5em .9em;
}

.site-actions .copy-button {
  fill: #fff;
  background: var(--muted);
}

.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 1em;
  }
  .login-panel, .app-panel {
    min-width: 0;
    padding: 1.1em;
  }
  body {
    font-size: 1rem;
  }

  #addForm,
  .actions form {
    flex-wrap: wrap;
  }
