/* ============================================================
   Color palette — mirrors www.grigolato.it (Astra/UAGB theme)
   --primary:   #21B4A6  teal accent
   --hover:     #0FAF9F  teal hover
   --bg:        #111A28  page background (very dark navy)
   --card:      #1C2A3C  container / card background
   --heading:   #FFFFFF  headings
   --body-text: #EDF6F3  body copy (light mint)
   --border:    #4E4E4E  borders / dividers
   ============================================================ */

/* General Body Styles */
body {
    font-family: 'Lato', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #111A28;
    color: #EDF6F3;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
}

.container {
    width: 80%;
    max-width: 960px;
    margin: 20px auto;
    padding: 20px;
    background-color: #1C2A3C;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Headings */
h1, h2, h3 {
    font-family: 'Poppins', 'Lato', sans-serif;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

/* Paragraphs and Links */
p {
    line-height: 1.7;
    text-align: center;
    color: #EDF6F3;
}

a {
    color: #21B4A6;
    text-decoration: none;
}

a:hover {
    color: #0FAF9F;
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    background-color: #21B4A6;
    color: #FFFFFF;
    padding: 10px 20px;
    border: 2px solid #21B4A6;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    font-size: 1em;
    text-align: center;
    text-decoration: none;
    margin-top: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background-color 0.2s, border-color 0.2s;
}

.btn:hover {
    background-color: #0FAF9F;
    border-color: #0FAF9F;
    text-decoration: none;
    color: #FFFFFF;
}

/* Scanner Page */
#loadingMessage {
    text-align: center;
    font-style: italic;
    margin-top: 20px;
    color: #EDF6F3;
}

#canvas {
    display: block;
    margin: 20px auto;
    max-width: 100%;
    border-radius: 8px;
}

/* ============================================================
   APP HEADER
   ============================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #0d1520;
    border-bottom: 1px solid #2a3a4c;
    width: 100%;
    box-sizing: border-box;
}

.header-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
    display: block;
}

.header-divider {
    width: 1px;
    height: 22px;
    background: #2a3a4c;
    flex-shrink: 0;
}

.header-product {
    font-size: 0.92em;
    color: #EDF6F3;
    opacity: 0.75;
    flex: 1;
}

.btn--sm {
    padding: 6px 14px;
    font-size: 0.8em;
    margin-top: 0;
}

.header-cta {
    margin-left: auto;
}

/* ============================================================
   PAGE SECTIONS
   ============================================================ */
.page-section {
    width: 100%;
    box-sizing: border-box;
    padding: 60px 0;
    border-bottom: 1px solid #2a3a4c;
}

.section-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 40px;
}

.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2em;
    font-weight: 700;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 8px;
    padding-bottom: 0;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: #21B4A6;
    margin: 12px auto 0;
    border-radius: 2px;
}

.section-lead {
    text-align: center;
    color: #aac;
    font-size: 0.95em;
    margin-top: 8px;
    margin-bottom: 0;
}

.subsection-title {
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.3em;
    font-weight: 700;
    color: #FFFFFF;
    margin-top: 48px;
    margin-bottom: 24px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.app-footer {
    width: 100%;
    background: #0d1520;
    padding: 32px 0;
    box-sizing: border-box;
    margin-top: auto;
}

.footer-inner {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-logo-link {
    display: inline-block;
    text-decoration: none;
}

.footer-logo {
    height: 72px;
    width: auto;
    display: block;
    opacity: 0.92;
    transition: opacity 0.2s;
}

.footer-logo-link:hover .footer-logo {
    opacity: 1;
}

.footer-tagline {
    font-size: 0.8em;
    color: #21B4A6;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

.footer-copy {
    font-size: 0.78em;
    color: #aac;
    margin: 0;
}

.footer-links {
    font-size: 0.78em;
    color: #aac;
    margin: 6px 0 0;
}
.footer-links a {
    color: #21B4A6;
    text-decoration: none;
}
.footer-links a:hover {
    text-decoration: underline;
}

/* ============================================================
   Product Info Page
   ============================================================ */
pre {
    background-color: #061314;
    color: #EDF6F3;
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    text-align: left;
    border-left: 3px solid #21B4A6;
}

/* ============================================================
   B2B-SPECIFIC: ACTION GRID (Dashboard quick actions)
   ============================================================ */
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 40px;
}

.action-card {
    background: #1C2A3C;
    border-radius: 10px;
    padding: 36px 28px;
    border: 1px solid #2a3a4c;
    border-top: 3px solid #21B4A6;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 180px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.action-card:hover {
    background: #223448;
    border-color: #21B4A6;
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(33, 180, 166, 0.18);
    text-decoration: none;
    color: inherit;
}

.action-card--wide {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    min-height: auto;
}

.action-card--wide .action-card-desc {
    flex: 1;
}

.action-card--wide .action-card-arrow {
    margin-top: 0;
    flex-shrink: 0;
}

.action-card-icon {
    font-size: 2.4em;
    line-height: 1;
}

.action-card-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
}

.action-card-desc {
    font-size: 0.87em;
    color: #aac;
    line-height: 1.5;
    text-align: left;
    margin: 0;
    flex: 1;
}

.action-card-arrow {
    font-size: 1.3em;
    color: #21B4A6;
    margin-top: auto;
    display: block;
    transition: transform 0.2s;
}

.action-card:hover .action-card-arrow {
    transform: translateX(5px);
}

/* ============================================================
   B2B-SPECIFIC: ACTIVITY TABLE
   ============================================================ */
.activity-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 32px;
    font-size: 0.9em;
}

.activity-table thead tr {
    background: #0d1520;
}

.activity-table th {
    text-align: left;
    padding: 12px 16px;
    color: #21B4A6;
    font-weight: 700;
    font-size: 0.82em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #2a3a4c;
}

.activity-table td {
    padding: 12px 16px;
    color: #EDF6F3;
    border-bottom: 1px solid #1C2A3C;
}

.activity-table tbody tr:nth-child(even) {
    background: #16233A;
}

.activity-table tbody tr:hover {
    background: #1C2A3C;
}

/* ============================================================
   B2B-SPECIFIC: INNER PAGES (forms, scanner, etc.)
   ============================================================ */
.back-link {
    display: inline-block;
    font-size: 0.88em;
    color: #21B4A6;
    text-decoration: none;
    margin-bottom: 28px;
}

.back-link:hover {
    color: #0FAF9F;
    text-decoration: underline;
}

.inner-page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: #FFFFFF;
    text-align: left;
    margin: 0 0 8px;
    position: relative;
    padding-bottom: 14px;
}

.inner-page-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background: #21B4A6;
    border-radius: 2px;
    position: absolute;
    bottom: 0;
    left: 0;
}

.form-page {
    max-width: 700px;
    margin: 0 auto;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.field-group label {
    font-size: 0.88em;
    color: #aac;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input[type="text"],
input[type="url"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
    background: #0d1520;
    border: 1px solid #2a3a4c;
    color: #EDF6F3;
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Lato', sans-serif;
    font-size: 0.95em;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="datetime-local"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: #21B4A6;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

select option {
    background: #0d1520;
}

/* ============================================================
   B2B-SPECIFIC: SCANNER / CAMERA BOX
   ============================================================ */
.camera-box {
    background: #0d1520;
    border: 1px solid #2a3a4c;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}

.camera-box video,
.camera-box canvas {
    border-radius: 8px;
    max-width: 100%;
}

/* ============================================================
   B2B-SPECIFIC: SSCC RESULT CARD
   ============================================================ */
.sscc-result {
    background: #1C2A3C;
    border: 1px solid #2a3a4c;
    border-left: 4px solid #21B4A6;
    border-radius: 8px;
    padding: 20px 24px;
    margin-top: 32px;
}

.sscc-result h3 {
    text-align: left;
    font-size: 1em;
    color: #21B4A6;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sscc-result p {
    text-align: left;
    font-size: 0.9em;
    color: #EDF6F3;
    margin: 6px 0;
}

.sscc-result p strong {
    color: #aac;
}

/* ============================================================
   HEADER ACTIONS (wallet, auth, language)
   ============================================================ */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Font Awesome icons inside action cards */
.action-card .action-card-icon i {
    color: #21B4A6;
}

/* ── Language selector ─────────────────────────────────────── */
.lang-selector { position: relative; }

.lang-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid #2a3a4c;
    border-radius: 6px;
    padding: 6px 10px;
    color: #EDF6F3;
    font-size: 1em;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.lang-btn:hover {
    border-color: #21B4A6;
    background: #1C2A3C;
}

.lang-chevron {
    font-size: 0.65em;
    opacity: 0.55;
    transition: transform 0.2s;
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1C2A3C;
    border: 1px solid #2a3a4c;
    border-radius: 8px;
    padding: 6px;
    min-width: 150px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.lang-dropdown.open { display: block; }

.lang-option {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 12px;
    color: #EDF6F3;
    font-family: 'Lato', sans-serif;
    font-size: 0.88em;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}

.lang-option:hover {
    background: #223448;
    color: #21B4A6;
}

/* ── Phantom wallet button ─────────────────────────────────── */
.wallet-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid #2a3a4c;
    border-radius: 6px;
    padding: 6px 13px;
    color: #EDF6F3;
    font-family: 'Lato', sans-serif;
    font-size: 0.85em;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    white-space: nowrap;
}

.wallet-btn:hover {
    border-color: #9945FF;
    background: rgba(153, 69, 255, 0.08);
    color: #b57dff;
}

.wallet-btn.wallet-connected {
    border-color: #9945FF;
    color: #b57dff;
    background: rgba(153, 69, 255, 0.10);
}

.wallet-btn i { font-size: 0.95em; }

/* ── Google Sign-In button ─────────────────────────────────── */
.sign-in-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: none;
    border-radius: 6px;
    padding: 6px 13px;
    color: #3c3c3c;
    font-family: 'Lato', sans-serif;
    font-size: 0.85em;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
}

.sign-in-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #3c3c3c;
}

.google-icon { width: 16px; height: 16px; flex-shrink: 0; }

/* ── User pill (logged-in state) ───────────────────────────── */
.user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #1C2A3C;
    border: 1px solid #2a3a4c;
    border-radius: 24px;
    padding: 4px 12px 4px 4px;
}

.user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.83em;
    color: #EDF6F3;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sign-out-btn {
    font-size: 0.78em;
    color: #aac;
    text-decoration: none;
    border-left: 1px solid #2a3a4c;
    padding-left: 8px;
    margin-left: 2px;
    transition: color 0.2s;
}

.sign-out-btn:hover {
    color: #21B4A6;
    text-decoration: none;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 768px) {
    .action-grid {
        grid-template-columns: 1fr;
    }

    .action-card--wide {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-card--wide .action-card-arrow {
        margin-top: auto;
    }

    .section-inner,
    .footer-inner {
        padding: 0 20px;
    }

    .header-inner {
        padding: 14px 20px;
    }
}
