/* ============================================
   APIS Energy — Onboarding CMS
   Dark Premium Theme with Glassmorphism
   ============================================ */

/* --- Design Tokens --- */
:root {
    /* Backgrounds */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2236;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.07);
    --bg-input: rgba(255, 255, 255, 0.05);

    /* Text */
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #60a5fa;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(96, 165, 250, 0.5);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(96, 165, 250, 0.15);

    /* Brand Colors */
    --clr-goodwe: #00B894;
    --clr-huawei: #E74C3C;
    --clr-solax: #F39C12;
    --clr-solis: #9B59B6;
    --clr-invt: #8D6E63;

    /* Layout */
    --sidebar-width: 280px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-smooth: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle animated background */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(96, 165, 250, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- App Shell --- */
.app-shell {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition-smooth);
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.4));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(250, 204, 21, 0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(250, 204, 21, 0.7)); }
}

.logo-title {
    font-size: 1.15rem;
    font-weight: 700;
    display: block;
    background: linear-gradient(135deg, #f0f4f8 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Brand Navigation Pills --- */
.brand-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
}

.brand-pill::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-color);
    transform: scaleY(0);
    transition: transform var(--transition-normal);
}

.brand-pill:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.brand-pill.active {
    background: var(--bg-glass);
    color: var(--text-primary);
    border-color: var(--border-medium);
    box-shadow: inset 0 0 20px rgba(var(--brand-color-rgb), 0.05);
}

.brand-pill.active::before {
    transform: scaleY(1);
}

.brand-pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-color);
    flex-shrink: 0;
    box-shadow: 0 0 8px var(--brand-color);
}

.brand-pill-info {
    flex: 1;
    overflow: hidden;
}

.brand-pill-name {
    display: block;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-pill-count {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 400;
}

.brand-pill-status {
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.brand-pill-status.active-status {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.brand-pill-status.pending-status {
    background: rgba(250, 204, 21, 0.15);
    color: #fbbf24;
}

.brand-pill-status.inactive-status {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

/* --- Sidebar Footer --- */
.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-meta {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    padding-top: 4px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: rgba(255,255,255,0.15);
}

.btn-icon { font-size: 1rem; }

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    color: #fff;
    font-weight: 600;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-accent {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    font-weight: 600;
}
.btn-accent:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border-medium);
}

.btn-icon-only {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: transform var(--transition-fast);
}
.btn-icon-only:hover { transform: scale(1.15); }

.btn-unlock {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.1), rgba(245, 158, 11, 0.1));
    border-color: rgba(250, 204, 21, 0.2);
    color: #fbbf24;
}
.btn-unlock:hover {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.2), rgba(245, 158, 11, 0.2));
    border-color: rgba(250, 204, 21, 0.4);
    color: #fde68a;
}
.btn-unlock.unlocked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-export {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(109, 40, 217, 0.1));
    border-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}
.btn-export:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(109, 40, 217, 0.2));
    border-color: rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    width: auto;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 32px 40px;
    max-width: 960px;
}

/* --- Brand Panel --- */
.brand-panel {
    display: none;
    animation: fadeSlideIn 0.4s ease forwards;
}

.brand-panel.active {
    display: block;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Brand Header --- */
.brand-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.brand-logo-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 4px 20px rgba(var(--brand-color-rgb), 0.35);
    flex-shrink: 0;
    position: relative;
}

.brand-logo-circle::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid rgba(var(--brand-color-rgb), 0.3);
    animation: ring-pulse 3s ease-in-out infinite;
}

@keyframes ring-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.brand-header-text h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.brand-header-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.brand-header-badges {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-online {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-plants {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.25);
}

/* --- Section --- */
.section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title-icon {
    font-size: 1rem;
}

/* --- Cards --- */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
}

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

/* --- Credential Form --- */
.cred-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cred-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cred-field.full-width {
    grid-column: 1 / -1;
}

.cred-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cred-label .required {
    color: #f87171;
    font-weight: 700;
}

.cred-input {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 0.88rem;
    transition: all var(--transition-fast);
    outline: none;
}

.cred-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.cred-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    background: rgba(255, 255, 255, 0.07);
}

.cred-input.has-value {
    border-color: rgba(16, 185, 129, 0.3);
}

.cred-input.masked {
    -webkit-text-security: disc;
    text-security: disc;
    font-family: 'Inter', sans-serif;
    letter-spacing: 2px;
}

.cred-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.cred-input-wrapper .cred-input {
    width: 100%;
    padding-right: 40px;
}

.cred-toggle-visibility {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    transition: color var(--transition-fast);
}

.cred-toggle-visibility:hover {
    color: var(--text-primary);
}

/* --- Onboarding Checklist --- */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.checklist-item:hover {
    background: var(--bg-glass-hover);
}

.checklist-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border-medium);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    margin-top: 1px;
    font-size: 0.72rem;
    color: transparent;
}

.checklist-item.checked .checklist-check {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.checklist-text {
    flex: 1;
}

.checklist-step {
    font-weight: 600;
    font-size: 0.88rem;
    display: block;
    margin-bottom: 2px;
    transition: color var(--transition-fast);
}

.checklist-item.checked .checklist-step {
    color: var(--text-muted);
    text-decoration: line-through;
}

.checklist-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: block;
    line-height: 1.5;
}

/* --- API Info Card --- */
.api-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.api-info-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
}

.api-info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.api-info-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    word-break: break-all;
}

.api-info-value a {
    color: var(--text-accent);
    text-decoration: none;
}
.api-info-value a:hover { text-decoration: underline; }

/* --- Notes --- */
.notes-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition-fast);
    line-height: 1.6;
}

.notes-textarea::placeholder { color: var(--text-muted); }
.notes-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

/* --- Warning / Tip Boxes --- */
.info-box {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.info-box-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.info-box.warning {
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.15);
    color: #fde68a;
}

.info-box.tip {
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.15);
    color: #bfdbfe;
}

.info-box.danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: modalFadeIn 0.25s ease;
}

.modal-overlay.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s ease;
    text-align: center;
}

.modal-wide {
    max-width: 640px;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-icon {
    font-size: 2.8rem;
    margin-bottom: 16px;
}

.modal-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.modal-card code {
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.82rem;
}

.modal-input-group {
    margin-bottom: 24px;
}

.modal-input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 3px;
    outline: none;
    transition: all var(--transition-fast);
}

.modal-input-group input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.input-hint {
    display: block;
    font-size: 0.75rem;
    margin-top: 8px;
    min-height: 18px;
}

.input-hint.error { color: #f87171; }
.input-hint.success { color: #34d399; }

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.modal-actions .btn {
    width: auto;
    min-width: 120px;
}

/* --- Export Output --- */
.export-output {
    width: 100%;
    min-height: 240px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    color: #a5f3fc;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    resize: vertical;
    outline: none;
    margin-bottom: 20px;
    line-height: 1.7;
    text-align: left;
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 90;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
}

.mobile-title {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.mobile-actions {
    display: flex;
    gap: 4px;
}

.hamburger {
    width: 32px;
    height: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* --- Save Indicator --- */
.save-flash {
    animation: saveFlash 0.6s ease;
}

@keyframes saveFlash {
    0% { color: var(--text-muted); }
    30% { color: #34d399; }
    100% { color: var(--text-muted); }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .mobile-header {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        padding: 72px 16px 24px;
        max-width: 100%;
    }

    .brand-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .brand-header-badges {
        margin-left: 0;
    }

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

    .api-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* --- Tooltip micro --- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-medium);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* --- Credential visibility states --- */
.cred-hidden-text {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
}

.unlocked-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #34d399;
    font-weight: 600;
    margin-left: 8px;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: var(--radius-pill);
}

/* --- Progress bar for onboarding --- */
.progress-bar-wrapper {
    margin-bottom: 20px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-bar-track {
    height: 6px;
    background: var(--bg-glass);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--brand-color), rgba(var(--brand-color-rgb), 0.6));
    box-shadow: 0 0 8px rgba(var(--brand-color-rgb), 0.3);
}

/* --- Additional Accounts --- */
.account-card {
    position: relative;
    transition: all var(--transition-normal);
}

.account-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 12px;
}

.account-card-meta {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.account-card-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 4px;
}

.account-card-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.account-name-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: var(--text-primary);
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: all var(--transition-fast);
    width: 100%;
}

.account-owner-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 400;
    outline: none;
    transition: all var(--transition-fast);
    width: 100%;
}

.account-name-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

.account-owner-input::placeholder {
    color: rgba(255, 255, 255, 0.15);
    font-style: italic;
}

.account-name-input:hover,
.account-name-input:focus,
.account-owner-input:hover,
.account-owner-input:focus {
    background: var(--bg-input);
    border-color: var(--border-medium);
}

.account-name-input:focus,
.account-owner-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.btn-remove-account,
.btn-remove-station {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: #f87171;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-remove-account:hover,
.btn-remove-station:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    transform: scale(1.1);
}

.btn-add-account,
.btn-add-station {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-add-account:hover,
.btn-add-station:hover {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(59, 130, 246, 0.2));
    border-color: rgba(96, 165, 250, 0.4);
    color: #93c5fd;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

/* --- Empty State --- */
.empty-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: var(--bg-glass);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.empty-state-icon {
    font-size: 1.4rem;
    opacity: 0.6;
    flex-shrink: 0;
}

/* --- Stations Table --- */
.stations-table-wrapper {
    overflow-x: auto;
    padding: 0;
}

.stations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stations-table thead th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-medium);
    white-space: nowrap;
}

.stations-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.station-row {
    transition: background var(--transition-fast);
}

.station-row:hover {
    background: var(--bg-glass-hover);
}

.station-row-num {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
    min-width: 32px;
}

.station-input {
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    color: var(--text-primary);
    font-family: 'Inter', monospace;
    font-size: 0.82rem;
    outline: none;
    transition: all var(--transition-fast);
    width: 100%;
    min-width: 100px;
}

.station-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.78rem;
}

.station-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.station-input.masked {
    -webkit-text-security: disc;
    text-security: disc;
    letter-spacing: 2px;
}

/* Responsive for stations */
@media (max-width: 768px) {
    .stations-table-wrapper {
        overflow-x: auto;
    }
    
    .stations-table {
        min-width: 600px;
    }
    
    .btn-add-account,
    .btn-add-station {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
}
