/* ============================================
   CloudHost Panel - Stylesheet
   Dark theme, modern hosting-panel aesthetic
   ============================================ */

:root {
    --bg:         #0a0e1a;
    --bg-2:       #0f172a;
    --bg-3:       #1e293b;
    --bg-4:       #334155;
    --border:     #1e293b;
    --border-2:   #334155;
    --text:       #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim:   #64748b;
    --accent:     #6366f1;
    --accent-2:   #8b5cf6;
    --accent-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --success:    #10b981;
    --warn:       #f59e0b;
    --danger:     #ef4444;
    --radius:     12px;
    --radius-sm:  8px;
    --shadow:     0 10px 30px rgba(0,0,0,0.4);
    --font-display: 'Sora', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-display);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    min-height: 100vh;
    background-image:
        radial-gradient(at 0% 0%, rgba(99,102,241,0.15) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139,92,246,0.10) 0px, transparent 50%);
    background-attachment: fixed;
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.1rem; }

p { color: var(--text-muted); }

code { font-family: var(--font-mono); background: var(--bg-3); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}
.logo svg { color: var(--accent); }
.topnav { display: flex; gap: 8px; align-items: center; }
.topnav > a { padding: 8px 14px; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 500; font-size: 14px; }
.topnav > a:hover { color: var(--text); background: var(--bg-3); }
.badge { background: var(--accent-grad); color: #fff !important; padding: 6px 12px !important; font-size: 12px !important; font-weight: 600 !important; text-transform: uppercase; letter-spacing: 0.05em; }

/* User menu */
.user-menu { position: relative; }
.user-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    border-radius: 50px;
    color: var(--text);
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    transition: all .15s;
}
.user-btn:hover { border-color: var(--accent); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent-grad);
    color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 12px;
}
.user-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--bg-3);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-width: 180px;
    overflow: hidden;
    opacity: 0; pointer-events: none;
    transform: translateY(-6px);
    transition: all .15s;
}
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }
.user-dropdown a { display: block; padding: 10px 16px; color: var(--text-muted); font-size: 14px; }
.user-dropdown a:hover { background: var(--bg-4); color: var(--text); }

/* ============================================
   BUTTONS
   ============================================ */
.btn, .btn-primary, .btn-ghost, .btn-secondary, .btn-danger {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,0.4); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(99,102,241,0.5); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--bg-3); color: var(--text); }
.btn-secondary { background: var(--bg-3); color: var(--text); border-color: var(--border-2); }
.btn-secondary:hover { background: var(--bg-4); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================
   FLASH
   ============================================ */
.flash { padding: 12px 0; font-weight: 500; font-size: 14px; }
.flash-success { background: rgba(16,185,129,0.15); color: #34d399; border-bottom: 1px solid rgba(16,185,129,0.3); }
.flash-error { background: rgba(239,68,68,0.15); color: #f87171; border-bottom: 1px solid rgba(239,68,68,0.3); }
.flash-info { background: rgba(99,102,241,0.15); color: #a5b4fc; border-bottom: 1px solid rgba(99,102,241,0.3); }
.flash-warn { background: rgba(245,158,11,0.15); color: #fbbf24; border-bottom: 1px solid rgba(245,158,11,0.3); }

/* ============================================
   MAIN / LANDING
   ============================================ */
.main { min-height: calc(100vh - 64px - 200px); padding: 40px 0; }

.hero {
    padding: 80px 0 100px;
    text-align: center;
    position: relative;
}
.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 24px;
    letter-spacing: -0.04em;
}
.hero h1 .grad {
    background: var(--accent-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero p.lead { font-size: 1.25rem; max-width: 640px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Features grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 60px 0;
}
.feature {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: all .2s;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-grad);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.feature h3 { margin-bottom: 8px; }

/* ============================================
   PRODUCT CARDS
   ============================================ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}
.product-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    position: relative;
    transition: all .2s;
    display: flex; flex-direction: column;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.product-card.featured { border-color: var(--accent); }
.product-card.featured::before {
    content: 'Empfohlen';
    position: absolute; top: -10px; right: 20px;
    background: var(--accent-grad);
    color: #fff;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.product-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.product-price { font-size: 2.5rem; font-weight: 800; margin: 16px 0; line-height: 1; }
.product-price .currency { font-size: 1.25rem; vertical-align: top; }
.product-price .period { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }
.product-specs { list-style: none; margin: 24px 0; flex-grow: 1; }
.product-specs li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
    color: var(--text-muted);
    font-size: 14px;
}
.product-specs li svg { color: var(--success); flex-shrink: 0; }
.product-specs li b { color: var(--text); font-weight: 600; }

/* ============================================
   FORMS
   ============================================ */
.auth-wrap {
    max-width: 440px;
    margin: 60px auto;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
}
.auth-wrap h1 { font-size: 1.875rem; margin-bottom: 8px; }
.auth-wrap p.sub { color: var(--text-muted); margin-bottom: 32px; }

.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], select, textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: all .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
input::placeholder { color: var(--text-dim); }

.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.form-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--text-muted); }

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */
.dashboard {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    padding: 32px 0;
}
.sidebar { position: sticky; top: 88px; align-self: start; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}
.sidebar nav a:hover { background: var(--bg-3); color: var(--text); }
.sidebar nav a.active { background: var(--bg-3); color: var(--text); }
.sidebar nav a.active::before { content: ''; width: 3px; height: 18px; background: var(--accent); border-radius: 2px; margin-right: -5px; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.stat-label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat-value { font-size: 2rem; font-weight: 800; margin-top: 6px; }
.stat-foot { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Cards */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin: -24px -24px 20px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.card-header h3 { font-size: 1rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover { background: var(--bg-3); }

/* Server status */
.status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.status-running .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-stopped .status-dot { background: var(--text-dim); }
.status-suspended .status-dot { background: var(--warn); }
.status-provisioning .status-dot { background: var(--accent); animation: pulse 1.5s infinite; }
.status-error .status-dot,
.status-terminated .status-dot { background: var(--danger); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.status-pill {
    display: inline-flex; align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg-3);
}

/* Server actions */
.server-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-2);
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 60px 0 24px;
}
.footer-inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 { font-size: 14px; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.footer-col a { display: block; padding: 4px 0; color: var(--text-muted); font-size: 14px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .dashboard { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .sidebar nav { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .topnav > a { display: none; }
    .topnav .btn-primary, .topnav .btn-ghost, .topnav .user-menu { display: flex; }
    .hero { padding: 60px 0; }
    .footer-inner { grid-template-columns: 1fr; }
    .auth-wrap { margin: 20px; padding: 28px 20px; }
}
