@import url('https://fonts.googleapis.com/css2?family=Clash+Display:wght@400;500;600;700&family=Satoshi:ital,opsz,wght@0,14..32,300..900;1,14..32,300..900&display=swap');

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

:root {
  --bg: #14111F;
  --purple: #8B5CF6;
  --purple-light: #A78BFA;
  --purple-dark: #6D3FE0;
  --text: #F0EEF7;
  --text-muted: #9691AC;
  --white: #1D1930;
  --danger: #F87171;
  --card: rgba(29,25,48,0.7);
  --card-border: rgba(139,92,246,0.18);
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.45);
  --radius: 16px;
  --radius-sm: 12px;
}

html, body { height: 100%; font-family: 'Satoshi', sans-serif; background: var(--bg); color: var(--text); overflow-x: hidden; }

.screen { display: none; min-height: 100vh; flex-direction: column; }
.screen.active { display: flex; }
.hidden { display: none !important; }

#screen-master { align-items: center; justify-content: center; position: relative; }

.login-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.4; }
.orb1 { width: 560px; height: 560px; background: radial-gradient(circle, #9B7FF6, #6B3FF0); top: -180px; left: -120px; animation: drift1 12s ease-in-out infinite; }
.orb2 { width: 440px; height: 440px; background: radial-gradient(circle, #C4B5FD, #7C3AED); bottom: -120px; right: -100px; animation: drift2 15s ease-in-out infinite; }
.orb3 { width: 320px; height: 320px; background: radial-gradient(circle, #DDD6FE, #A78BFA); top: 50%; left: 50%; transform: translate(-50%, -50%); animation: drift3 18s ease-in-out infinite; }

@keyframes drift1 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(40px, 30px); } }
@keyframes drift2 { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(-30px, -40px); } }
@keyframes drift3 { 0%, 100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.15); } }

.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 380px; padding: 0 28px; display: flex; flex-direction: column; align-items: center; text-align: center; animation: fadeUp 0.6s cubic-bezier(0.22,1,0.36,1) both; }
.login-logo { width: 64px; height: 64px; object-fit: contain; margin-bottom: 18px; }
.login-headline { font-family: 'Clash Display', sans-serif; font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.login-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }

.master-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.input-wrap { position: relative; width: 100%; }
.input-wrap .nx-input { padding-right: 44px; }
.btn-eye { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; display: flex; align-items: center; }
.btn-eye:hover { color: var(--purple); }

.nx-input { width: 100%; padding: 12px 14px; background: rgba(29,25,48,0.8); border: 1.5px solid var(--card-border); border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 14px; color: var(--text); outline: none; transition: border-color 0.18s; }
.nx-input:focus { border-color: var(--purple); }
.nx-input::placeholder { color: var(--text-muted); }

.btn-primary { width: 100%; padding: 13px; background: var(--purple); color: #fff; border: none; border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.18s; }
.btn-primary:hover { background: var(--purple-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(107,63,240,0.35); }

.btn-ghost-sm { background: transparent; border: none; font-family: 'Satoshi', sans-serif; font-size: 13px; color: var(--text-muted); cursor: pointer; padding: 6px; }
.btn-ghost-sm:hover { color: var(--purple); }

.form-error { font-size: 13px; color: var(--danger); min-height: 18px; }

.nx-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: rgba(29,25,48,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--card-border); position: sticky; top: 0; z-index: 100; }
.nx-header-left { display: flex; align-items: center; gap: 10px; }
.header-logo { width: 28px; height: 28px; object-fit: contain; }
.header-brand { font-family: 'Clash Display', sans-serif; font-size: 16px; font-weight: 600; }
.nx-header-right { display: flex; align-items: center; gap: 8px; }

.btn-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: rgba(107,63,240,0.08); border: none; border-radius: 10px; cursor: pointer; color: var(--purple); transition: all 0.18s; }
.btn-icon:hover { background: rgba(107,63,240,0.16); transform: scale(1.05); }

.vault-search-wrap { padding: 14px 16px 0; }
.search-box { display: flex; align-items: center; gap: 10px; background: rgba(29,25,48,0.8); border: 1.5px solid var(--card-border); border-radius: var(--radius-sm); padding: 10px 14px; }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-input { flex: 1; background: none; border: none; outline: none; font-family: 'Satoshi', sans-serif; font-size: 14px; color: var(--text); }
.search-input::placeholder { color: var(--text-muted); }

.vault-main { padding: 14px 16px 32px; display: flex; flex-direction: column; gap: 10px; }

.vault-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; text-align: center; }
.empty-icon { width: 56px; height: 56px; object-fit: contain; opacity: 0.35; }
.empty-title { font-family: 'Clash Display', sans-serif; font-size: 17px; font-weight: 600; color: var(--text); }
.empty-sub { font-size: 13px; color: var(--text-muted); }

.vault-list { display: flex; flex-direction: column; gap: 10px; }

.vault-item { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; transition: all 0.18s; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.vault-item:hover { border-color: var(--purple); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

.vault-item-icon { width: 42px; height: 42px; border-radius: 12px; background: rgba(107,63,240,0.1); display: flex; align-items: center; justify-content: center; font-family: 'Clash Display', sans-serif; font-size: 17px; font-weight: 700; color: var(--purple); flex-shrink: 0; text-transform: uppercase; }
.vault-item-info { flex: 1; min-width: 0; }
.vault-item-name { font-weight: 700; font-size: 15px; color: var(--text); }
.vault-item-user { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vault-item-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-copy { padding: 6px 12px; background: rgba(107,63,240,0.08); border: none; border-radius: 8px; font-family: 'Satoshi', sans-serif; font-size: 12px; font-weight: 600; color: var(--purple); cursor: pointer; transition: all 0.15s; }
.btn-copy:hover { background: rgba(107,63,240,0.18); }
.btn-copy.copied { background: rgba(22,163,74,0.1); color: #16A34A; }

.modal-overlay { position: fixed; inset: 0; background: rgba(26,16,40,0.5); backdrop-filter: blur(4px); z-index: 200; display: flex; align-items: flex-end; justify-content: center; animation: fadeIn 0.2s; }
.modal-overlay.hidden { display: none; }

.modal { width: 100%; max-width: 480px; background: var(--white); border-radius: var(--radius) var(--radius) 0 0; padding: 20px; display: flex; flex-direction: column; gap: 16px; animation: slideUp 0.3s cubic-bezier(0.22,1,0.36,1); }

@media (min-width: 520px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius); max-height: 90vh; }
}

.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: 'Clash Display', sans-serif; font-size: 18px; font-weight: 700; }
.modal-body { display: flex; flex-direction: column; gap: 10px; }
.modal-footer { display: flex; gap: 10px; }
.modal-footer .btn-primary { flex: 1; }

.btn-generate { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; background: rgba(107,63,240,0.06); b!order: 1.5px dashed rgba(107,63,240,0.3); border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 13px; font-weight: 600; color: var(--purple); cursor: pointer; transition: all 0.18s; }
.btn-generate:hover { background: rgba(107,63,240,0.12); border-style: solid; }

.btn-danger-ghost { padding: 13px 16px; background: transparent; border: 1.5px solid rgba(229,62,62,0.25); border-radius: var(--radius-sm); font-family: 'Satoshi', sans-serif; font-size: 14px; font-weight: 600; color: var(--danger); cursor: pointer; transition: all 0.18s; }
.btn-danger-ghost:hover { background: rgba(229,62,62,0.08); }
.btn-danger-ghost.hidden { display: none; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: #2A2440; color: #F0EEF7; padding: 10px 20px; border-radius: 10px; font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.25s; z-index: 999; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
