:root {
    --primary: #000000;
    --secondary: #ffffff;
    --bg-page: #f5f5f5;
    --topbar-bg: #f0f0f0;
    --divider-1: #e8e8e8;
    --divider-2: #dddddd;
    --hero-overlay: rgba(50, 50, 50, 0.58);
    --accent-teal: #00b4cc;
    --accent-gold: #f5a623;
    --whatsapp: #25d366;
    --email: #000000;
    --text-main: #333333;
    --text-heading: #111111;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.topbar {
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--divider-2);
    min-height: 38px;
    display: flex;
    align-items: center;
}

.topbar-inner {
    display: flex;
    justify-content: center;
    gap: 24px;
    width: 100%;
    font-size: 13px;
    color: #444444;
}

.nav {
    height: 64px;
    background: var(--secondary);
    border-bottom: 1px solid var(--divider-1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo-wrap {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    position: relative;
    line-height: 0;
}

.brand-logo {
    width: auto;
    max-width: 330px;
    height: 42px;
    object-fit: contain;
    display: block;
}

.brand-logo-sidebar {
    width: 100%;
    max-width: 240px;
    height: auto;
}

.logo-black,
.logo-white {
    font-size: 15px;
    letter-spacing: 1px;
    font-weight: 700;
    padding: 6px 10px;
    text-transform: uppercase;
}

.logo-black {
    background: #000;
    color: #fff;
}

.logo-white {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}

.logo-reg {
    position: absolute;
    right: -10px;
    top: -6px;
    font-size: 10px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 14px;
    color: #333333;
}

.nav-links a:hover,
.nav-links a.active {
    color: #000000;
}

.hero {
    min-height: 480px;
    position: relative;
    background: linear-gradient(var(--hero-overlay), var(--hero-overlay)),
        url('../images/hero-cleaning.svg') center center / cover no-repeat;
}

.hero-content {
    min-height: 480px;
    display: grid;
    place-items: center;
    position: relative;
}

.hero-card {
    background: var(--hero-overlay);
    border-radius: 5px;
    padding: 32px 52px;
    max-width: 660px;
    text-align: center;
    color: #fff;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: 34px;
    line-height: 1.25;
    font-weight: 700;
    color: #fff;
}

.hero p {
    margin: 0 0 24px;
    color: #f0f0f0;
    font-size: 16px;
}

.btn,
button,
input[type='submit'] {
    border-radius: 0;
    border: 2px solid #000000;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: #ffffff;
    color: #000000;
}

.btn-dark {
    background: #000;
    color: #fff;
}

.hero .btn {
    padding: 13px 40px;
    font-size: 15px;
}

.stamp-badge {
    position: absolute;
    top: 60px;
    right: 140px;
    width: 138px;
    height: 138px;
    border: 2px dashed #555;
    border-radius: 50%;
    color: #f0f0f0;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 11px;
}

.stamp-badge strong {
    display: block;
    font-size: 14px;
}

.proven-widget {
    position: absolute;
    top: 0;
    right: 0;
    width: 130px;
    background: #fff;
    border-bottom-left-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
    color: #222;
    font-size: 11px;
}

.proven-widget .check {
    color: var(--accent-gold);
    font-size: 15px;
    font-weight: 700;
}

.proven-widget .teal-btn {
    background: var(--accent-teal);
    color: #fff;
    border: 0;
    width: 100%;
    padding: 6px;
    font-size: 11px;
    border-radius: 0;
}

.location-bar {
    background: #fff;
    border-top: 1px solid var(--divider-1);
    min-height: 50px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.section {
    padding: 64px 0;
}

h2.section-title {
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-heading);
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: #fff;
    border: 1px solid var(--divider-1);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 24px;
}

.card h3 {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--text-heading);
}

.stat-box {
    border: 1px solid var(--divider-1);
    border-left: 5px solid #000;
    padding: 20px;
    background: #fff;
}

.stat-box .label {
    font-size: 14px;
    color: #555;
}

.stat-box .value {
    font-size: 28px;
    font-weight: 700;
    color: #000;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='file'],
select,
textarea {
    width: 100%;
    border: 1px solid #cccccc;
    border-radius: 4px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    border: 1px solid #e8e8e8;
    padding: 10px;
    font-size: 14px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f5f5f5;
}

tr:hover td {
    background: #fafafa;
}

.badge {
    display: inline-block;
    border: 1px solid #000;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.alert {
    border: 1px solid #dddddd;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    margin-bottom: 16px;
}

.alert.success {
    border-left: 4px solid #000;
}

.alert.error {
    border-left: 4px solid #c0392b;
}

.portal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.portal-tabs a {
    border: 1px solid #000;
    background: #fff;
    font-size: 14px;
    padding: 8px 14px;
}

.portal-tabs a.active {
    background: #000;
    color: #fff;
}

.user-portal {
    padding-top: 32px;
}

.user-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.user-sidebar {
    background: #ffffff;
    border: 1px solid var(--divider-1);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 20px;
    position: sticky;
    top: 76px;
}

.user-sidebar-brand {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    position: relative;
    margin-bottom: 20px;
}

.user-sidebar-profile {
    border: 1px solid var(--divider-1);
    background: #fafafa;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.user-sidebar-profile strong {
    display: block;
    color: var(--text-heading);
    font-size: 15px;
}

.user-sidebar-profile span {
    display: block;
    font-size: 13px;
    color: #555;
    word-break: break-word;
}

.user-sidebar-nav {
    display: grid;
    gap: 8px;
}

.user-sidebar-nav a {
    border: 1px solid #dddddd;
    background: #fff;
    padding: 10px 12px;
    font-size: 14px;
    color: #222;
    transition: all 0.2s ease;
}

.user-sidebar-nav a:hover,
.user-sidebar-nav a.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

.user-main {
    min-width: 0;
}

.user-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.user-main-head .section-title {
    margin: 0;
}

.hint-text {
    font-size: 13px;
    color: #666;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: #ffffff;
    border: 1px solid var(--divider-1);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    padding: 18px;
}

.metric-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 30px;
    font-weight: 700;
    color: #111;
}

.metric-value-small {
    font-size: 19px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.card-head h3 {
    margin: 0;
}

.card-head a {
    font-size: 14px;
    text-decoration: underline;
}

.history-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.history-item {
    border: 1px solid var(--divider-1);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.history-preview {
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
}

.history-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.history-missing {
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 13px;
    color: #666;
}

.history-meta {
    padding: 12px;
    display: grid;
    gap: 5px;
}

.history-meta strong {
    font-size: 15px;
    color: #111;
}

.history-meta span {
    font-size: 13px;
    color: #666;
}

.history-meta a {
    font-size: 13px;
    color: #111;
    text-decoration: underline;
}

.empty-state {
    border: 1px dashed #cccccc;
    padding: 18px;
    font-size: 14px;
    color: #555;
    background: #fafafa;
}

.user-grid {
    align-items: start;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.generation-loader {
    border: 1px solid var(--divider-1);
    background: #fafafa;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    display: grid;
    gap: 12px;
}

.loader-rings {
    width: 64px;
    height: 64px;
    border: 4px solid #dcdcdc;
    border-top-color: #000000;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.loader-text {
    display: grid;
    gap: 4px;
}

.loader-text strong {
    font-size: 15px;
    color: #111;
}

.loader-text span {
    font-size: 13px;
    color: #666;
}

.loader-steps {
    display: grid;
    gap: 6px;
}

.loader-steps span {
    font-size: 13px;
    color: #444;
    padding-left: 18px;
    position: relative;
}

.loader-steps span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #000;
    animation: pulse 1.3s ease-in-out infinite;
}

.settings-avatar {
    max-width: 130px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.asset-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 10px;
    display: grid;
    gap: 8px;
    background: #fff;
}

.asset-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #f6f6f6;
    border: 1px solid #eee;
}

.asset-card strong {
    font-size: 14px;
}

.editor-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 20px;
}

.editor-left h4 {
    margin: 12px 0 8px;
    font-size: 14px;
    color: #111;
}

.editor-asset-list {
    display: grid;
    gap: 8px;
}

.asset-btn {
    border: 1px solid #d8d8d8;
    border-radius: 4px;
    padding: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
}

.asset-btn img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border: 1px solid #efefef;
    background: #fafafa;
}

.asset-btn.text {
    font-size: 13px;
}

.icon-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.icon-only {
    justify-content: center;
    text-align: center;
    font-size: 20px;
    padding: 10px 6px;
}

.editor-stage-wrap {
    min-width: 0;
}

.editor-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.editor-stage {
    position: relative;
    width: 100%;
    min-height: 460px;
    background: #f0f0f0;
    border: 1px solid #e4e4e4;
    overflow: hidden;
    touch-action: none;
}

.editor-stage > img {
    width: 100%;
    display: block;
}

.editor-overlay {
    position: absolute;
    inset: 0;
}

.snap-guide {
    position: absolute;
    pointer-events: none;
    z-index: 999;
    background: rgba(0, 180, 204, 0.9);
}

.snap-guide-x {
    top: 0;
    bottom: 0;
    width: 1px;
}

.snap-guide-y {
    left: 0;
    right: 0;
    height: 1px;
}

.editor-item {
    position: absolute;
    border: 1px dashed transparent;
    user-select: none;
    z-index: 2;
    touch-action: none;
    will-change: left, top, width, height;
}

.editor-item.selected {
    border-color: #000;
}

.editor-item .item-content {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.item-image-content {
    pointer-events: none;
}

.text-content {
    color: #fff;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.55);
    overflow: hidden;
}

.resize-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 14px;
    height: 14px;
    border: 1px solid #000;
    background: #fff;
    cursor: se-resize;
}

.result-box img {
    max-width: 100%;
    border: 1px solid #e8e8e8;
}

.float-buttons {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.float-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.float-btn.email {
    background: var(--email);
}

.float-btn.whatsapp {
    background: var(--whatsapp);
}

.footer {
    padding: 24px 0 64px;
    border-top: 1px solid #e8e8e8;
    background: #fff;
    margin-top: 48px;
}

@media (max-width: 991px) {
    .nav-links {
        gap: 12px;
        font-size: 13px;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 60%;
    }

    .stamp-badge,
    .proven-widget {
        display: none;
    }

    .grid-3,
    .grid-2,
    .form-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .user-shell {
        grid-template-columns: 1fr;
    }

    .user-sidebar {
        position: static;
    }

    .user-main-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .metric-grid,
    .history-gallery,
    .asset-grid {
        grid-template-columns: 1fr;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .icon-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-card {
        padding: 24px;
        margin: 0 16px;
    }

    .brand-logo {
        height: 34px;
        max-width: 250px;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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