/* ============================================================
   Tollsmart Developer Console — shared stylesheet
   ============================================================ */

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

:root {
    --green:      #4DA873;
    --green-dark: #084C32;
    --green-hover:#3d8a5c;
    --red:        #c0392b;
    --blue:       #2980b9;
    --text:       #1a1a1a;
    --text-muted: #555;
    --border:     #d4d4d4;
    --bg:         #f7f8fa;
    --bg-card:    #ffffff;
    --radius:     8px;
    --shadow:     0 2px 8px rgba(0,0,0,.10);
    --font:       'Inter', system-ui, -apple-system, sans-serif;
    --mono:       'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
}

html { font-size: 16px; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    padding-bottom: 60px; /* space for footer */
}

/* ---- Nav bar ---- */
.navbar {
    display: flex;
    align-items: center;
    background: var(--green);
    padding: 0 20px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}

.navbar .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    margin-right: auto;
}

.nav-icon {
    height: 36px;
    width: 36px;
    max-height: 36px;
    max-width: 36px;
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar .nav-links a {
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: .92rem;
    transition: background .2s;
}

.navbar .nav-links a:hover { background: rgba(255,255,255,.18); }

/* ---- User dropdown ---- */
.dropdown { position: relative; }

.dropbtn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    padding: 7px 14px;
    border-radius: 5px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .92rem;
    white-space: nowrap;
}

.dropbtn:hover { background: rgba(255,255,255,.28); }

.dropbtn::after { content: ' ▾'; font-size: .75rem; }

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #fff;
    min-width: 190px;
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    overflow: hidden;
    z-index: 200;
    margin-top: 4px;
}

.navbar .nav-links .dropdown-content a {
    display: block;
    padding: 11px 16px;
    color: var(--green-dark);
    text-decoration: none;
    font-size: .9rem;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    background: transparent;
}

.navbar .nav-links .dropdown-content a:last-child { border-bottom: none; }
.navbar .nav-links .dropdown-content a:hover { background: #f0faf4; color: var(--green-dark); }
.dropdown-content.open { display: block; }

/* ---- Page body wrapper ---- */
.page-content {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-content h1 { font-size: 1.6rem; margin-bottom: 6px; color: var(--green-dark); }
.page-content h2 { font-size: 1.35rem; margin-bottom: 10px; color: var(--green-dark); }
.page-content h3 { font-size: 1.05rem; margin: 20px 0 6px; color: var(--text); }
.page-content h4 { font-size: .95rem; margin: 10px 0 4px; color: var(--text-muted); }
.page-content p  { margin-bottom: 10px; color: var(--text-muted); }

/* ---- Plan cards ---- */
.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 24px;
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.plan-card h1 { font-size: 1.25rem; margin: 0; color: var(--green-dark); }

/* ---- Status badges ---- */
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.badge-active  { background: #d4edda; color: #155724; }
.badge-trial   { background: #cce5ff; color: #004085; }
.badge-inactive{ background: #f8d7da; color: #721c24; }

/* ---- API key display ---- */
.api-key {
    font-family: var(--mono);
    font-size: .9rem;
    background: #f1f3f5;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 8px 14px;
    display: inline-block;
    color: var(--green-dark);
    word-break: break-all;
    margin: 4px 0 12px;
}

/* ---- Forms ---- */
.form-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

select,
input[type=text],
input[type=password],
input[type=email],
textarea {
    font-family: var(--font);
    font-size: .9rem;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    color: var(--text);
    transition: border-color .2s;
}

select:focus,
input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus,
textarea:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(77,168,115,.15);
}

textarea { resize: vertical; width: 100%; }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .2s, box-shadow .2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--green);
    color: #fff;
}
.btn-primary:hover { background: var(--green-hover); box-shadow: 0 2px 6px rgba(77,168,115,.4); }

.btn-danger {
    background: var(--red);
    color: #fff;
}
.btn-danger:hover { background: #a93226; }

.btn-ghost {
    background: transparent;
    color: var(--green-dark);
    border: 1px solid var(--green);
}
.btn-ghost:hover { background: #f0faf4; }

/* ---- Generic submit (legacy forms that don't use .btn) ---- */
input[type=submit] {
    font-family: var(--font);
    font-size: .9rem;
    font-weight: 500;
    padding: 8px 18px;
    border: none;
    border-radius: 5px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    transition: background .2s;
}
input[type=submit]:hover { background: var(--green-hover); }

/* ---- Inline message colours ---- */
.msg-error  { color: var(--red); font-size: .9rem; }
.msg-success{ color: #155724; font-size: .9rem; }
.msg-info   { color: var(--blue); font-size: .9rem; }

/* ---- Invoice / credit memo cards ---- */
.invoice-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 16px;
}

.invoice-card .invoice-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 10px 0;
}

/* ---- Collapsible (AvailablePlans) ---- */
.collapsible-btn {
    width: 100%;
    text-align: left;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius);
    padding: 16px 20px;
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--green-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.collapsible-btn:hover { background: #f0faf4; }
.collapsible-btn::after { content: '+'; font-size: 1.3rem; font-weight: 700; }
.collapsible-btn.active::after { content: '−'; }

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease-out;
    padding: 0 20px;
    background: var(--bg-card);
}

/* ---- Contact form ---- */
.contact-grid {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px 16px;
    max-width: 600px;
    align-items: center;
}

.contact-grid label { font-weight: 500; }
.contact-grid textarea { min-height: 160px; }

/* ---- Footer ---- */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    background: #fff;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    overflow: hidden;
}

.footer-logo {
    height: 32px;
    max-height: 32px;
    width: auto;
    display: block;
    opacity: .85;
    object-fit: contain;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-footer a {
    color: var(--text-muted);
    font-size: .85rem;
    text-decoration: none;
}
.site-footer a:hover { color: var(--green-dark); }

/* ---- Login / register page ---- */
.login-box {
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 36px;
    margin: 40px auto;
}

.login-box h1 { font-size: 1.4rem; margin-bottom: 20px; }

.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-weight: 500; margin-bottom: 5px; }
.login-field input { width: 100%; }

.login-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 10px; }
    .navbar .nav-links { flex-wrap: wrap; }
    .contact-grid { grid-template-columns: 1fr; }
    .plan-card { padding: 16px; }
}

/* ---- View-Usage form widths (override tiny defaults) ---- */
.wide-select { width: auto; min-width: 280px; }
