/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

/* ── Variables ── */
:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #dc2626;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── Base ── */
* {
  font-family: system-ui, -apple-system, Arial, sans-serif;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 0;
}

h2 {
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
}

li {
  margin-bottom: 0.5rem;
}

/* ── Header ── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 450px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 1rem;
  gap: 0.5rem;
}

.logo {
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.header-nav {
  display: flex;
  gap: 0.125rem;
  flex: 1;
}

.header-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: calc(var(--radius) - 1px);
  white-space: nowrap;
  transition: color 0.1s, background 0.1s;
}

.header-nav a:hover {
  color: var(--text);
  background: var(--bg);
}

.header-logout {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.header-logout:hover {
  color: var(--text);
}

/* ── Main container ── */
#container {
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

/* ── Forms & labels ── */
.field {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}

input[type="text"],
input[type="password"],
input[type="email"] {
  padding: 0.5rem 0.625rem;
  font-size: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input[type="text"] {
  width: 100%;
}

input:disabled {
  background: var(--bg);
  color: var(--text);
  cursor: default;
}

/* ── Buttons ── */
input[type="submit"],
button {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.1s, border-color 0.1s;
}

button:hover {
  background: var(--bg);
}

input[type="submit"] {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

input[type="submit"]:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.danger {
  background: var(--danger) !important;
  color: white !important;
  border-color: var(--danger) !important;
}

.input-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
}

.d-input-btn {
  height: 100%;
}

/* ── Cards ── */
.pass {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.pass-link {
  text-decoration: none;
  color: var(--text);
}

.pass-name {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.pass-username {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.login {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem;
  border-radius: var(--radius);
  width: 100%;
  box-shadow: var(--shadow-sm);
}

.login p {
  margin: 0;
}

.login-details p {
  margin: 0.5rem 0;
}

.user {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
}

.user p {
  margin: 0;
}

/* ── Notices ── */
.notice {
  padding: 0.5rem 0.75rem;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  background: #f0fdf4;
  color: #166534;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  width: fit-content;
}

.alert {
  padding: 0.5rem 0.75rem;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  width: fit-content;
}

/* ── Auth code ── */
#auth_code {
  border-radius: var(--radius) 0 0 var(--radius);
  border-right-style: none;
  width: 0;
}

#auth_code_countdown {
  margin: auto;
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  border: 1px solid var(--border);
  border-left-style: none;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Secondary text ── */
.secondary {
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── Layout utilities ── */
.flex,
.flex-rotate {
  display: flex;
}

.flex input {
  flex-grow: 1;
}

.grow {
  flex-grow: 1;
}

.ml-1 {
  margin-left: 0.5rem;
}

.txt-btn {
  margin: auto;
  padding: 0 0.5rem;
}

/* ── Password fields ── */
.pass-w-show {
  display: flex;
}

.pass-w-show input[type="password"] {
  flex-grow: 1;
}

.password-input {
  display: flex;
}

.password-input input {
  flex-grow: 1;
}

/* ── Search ── */
.search {
  display: flex;
}

.search a {
  margin: auto;
  padding: 0 0.5rem;
}

/* ── Password generator ── */
.gen-pass {
  margin-left: 0.5rem;
}

/* ── Card ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  width: 100%;
  margin-top: 1.5rem;
}

.card h2 {
  margin-bottom: 1.25rem;
}

/* ── Secondary button ── */
.btn-secondary {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.btn-secondary:hover {
  background: var(--bg) !important;
}

/* ── Generated password display ── */
.gen-password {
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  word-break: break-all;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ── Search clear link ── */
.search-clear {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0 0.5rem;
  margin: auto;
  white-space: nowrap;
}

.search-clear:hover {
  color: var(--text);
}

/* ── Mobile ── */
@media only screen and (max-width: 768px) {
  .input-btn {
    width: inherit !important;
  }

  input[type="submit"],
  button {
    width: 100%;
    padding: 0.5rem;
  }

  .flex-rotate {
    flex-direction: column;
  }

  .gen-pass {
    margin-left: 0;
    margin-top: 0.5rem;
  }
}
