* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(25, 112, 255, 0.15), transparent 35%),
        #07111f;
    color: #f4f8ff;
    min-height: 100vh;
}

button,
input,
textarea,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

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


/* HEADER */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 14, 27, 0.94);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1250px;
    margin: auto;
    min-height: 76px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.brand img {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

.brand strong {
    display: block;
    font-size: 19px;
}

.brand span {
    display: block;
    margin-top: 2px;
    color: #8ea4c1;
    font-size: 11px;
}

.main-nav {
    display: flex;
    gap: 26px;
    flex: 1;
}

.main-nav a {
    color: #9db0c8;
    font-size: 14px;
    transition: 0.2s;
}

.main-nav a:hover {
    color: #ffffff;
}


/* BUTTONS */

.button {
    border: 0;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.15s, opacity 0.15s, background 0.15s;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.button-primary {
    background: #1683ff;
    color: white;
    box-shadow: 0 8px 25px rgba(22, 131, 255, 0.25);
}

.button-primary:hover {
    background: #3695ff;
}

.button-secondary {
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.12);
}

.button-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.18);
}

.button.full {
    width: 100%;
}


/* HERO */

.hero {
    padding: 90px 24px 80px;
}

.hero-inner {
    max-width: 1250px;
    margin: auto;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 80px;
    align-items: center;
}

.eyebrow {
    color: #4da3ff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.hero h1 {
    margin: 14px 0 20px;
    font-size: clamp(50px, 7vw, 88px);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.hero h1 span {
    color: #2d94ff;
}

.hero-copy > p {
    max-width: 570px;
    color: #9db0c8;
    font-size: 18px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.hero-card {
    border: 1px solid rgba(72, 159, 255, 0.2);
    background:
        linear-gradient(145deg, rgba(21, 93, 166, 0.2), rgba(255,255,255,0.035));
    border-radius: 22px;
    padding: 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
}

.hero-card-top {
    display: flex;
    justify-content: space-between;
    color: #7992b1;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.status-dot {
    color: #55d88a;
}

.hero-card-logo {
    width: 150px;
    height: 150px;
    margin: 45px auto 30px;
    border-radius: 30px;
    display: grid;
    place-items: center;
    background: rgba(0,0,0,0.2);
}

.hero-card-logo img {
    width: 105px;
    height: 105px;
    object-fit: contain;
}

.hero-card strong {
    display: block;
    font-size: 20px;
}

.hero-card p {
    color: #8fa6c2;
    line-height: 1.6;
}


/* SEARCH */

.search-section {
    padding: 0 24px 30px;
}

.search-wrap {
    max-width: 900px;
    margin: auto;
}

.search-box {
    height: 62px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background: #0c1a2c;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
}

.search-icon {
    color: #7188a3;
    font-size: 27px;
    margin-right: 12px;
}

.search-box input {
    width: 100%;
    background: transparent;
    color: white;
    border: 0;
    outline: 0;
    font-size: 16px;
}

.search-box input::placeholder {
    color: #657b95;
}

.search-tags {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.search-tags button {
    border: 1px solid rgba(255,255,255,0.08);
    background: #0b1727;
    color: #91a6bf;
    border-radius: 100px;
    padding: 8px 14px;
    cursor: pointer;
}

.search-tags button:hover {
    color: white;
    border-color: #258dff;
}


/* SECTIONS */

.section {
    max-width: 1250px;
    margin: auto;
    padding: 70px 24px;
}

.section-heading {
    margin-bottom: 28px;
}

.section-heading h2 {
    margin: 8px 0;
    font-size: 36px;
    letter-spacing: -0.03em;
}

.section-heading p {
    color: #7890ab;
    margin: 0;
}


/* CATEGORY */

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

.category-card {
    text-align: left;
    border: 1px solid rgba(255,255,255,0.08);
    background: #0c192a;
    border-radius: 16px;
    padding: 24px;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

.category-card:hover {
    border-color: rgba(44,148,255,0.55);
    transform: translateY(-3px);
}

.category-icon {
    display: block;
    color: #3e9bff;
    font-size: 28px;
    margin-bottom: 20px;
}

.category-card strong {
    display: block;
    font-size: 17px;
    margin-bottom: 6px;
}

.category-card span:last-child {
    color: #7087a1;
    font-size: 13px;
}


/* LIBRARY */

.library-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: end;
}

.library-controls {
    display: flex;
    gap: 8px;
}

.library-controls select,
.form-group select {
    color: white;
    background: #0c192a;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 9px;
    padding: 10px 12px;
    outline: none;
}

.schematic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.schematic-card {
    overflow: hidden;
    border-radius: 16px;
    background: #0c192a;
    border: 1px solid rgba(255,255,255,0.08);
}

.schematic-image {
    height: 190px;
    background:
        linear-gradient(135deg, #10243a, #07111f);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.schematic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image {
    color: #54708d;
    font-size: 40px;
}

.schematic-body {
    padding: 20px;
}

.schematic-category {
    color: #3e9bff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.schematic-body h3 {
    margin: 7px 0;
    font-size: 20px;
}

.schematic-description {
    color: #7e94ad;
    font-size: 13px;
    line-height: 1.55;
    min-height: 41px;
}

.schematic-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    color: #66809d;
    font-size: 12px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.schematic-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.schematic-actions a,
.schematic-actions button {
    flex: 1;
    text-align: center;
    padding: 9px 10px;
    border-radius: 8px;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.download-button {
    background: #1683ff;
    color: white;
}

.delete-button {
    background: rgba(255,255,255,0.07);
    color: #ff8b8b;
}


/* EMPTY */

.empty-state {
    text-align: center;
    padding: 80px 20px;
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: 16px;
}

.empty-state.hidden {
    display: none;
}

.empty-icon {
    font-size: 50px;
    color: #31506f;
}

.empty-state h3 {
    margin-bottom: 6px;
}

.empty-state p {
    color: #7289a2;
}


/* UPLOAD */

.upload-section {
    margin: 50px 24px;
}

.upload-inner {
    max-width: 1200px;
    margin: auto;
    padding: 42px;
    border-radius: 20px;
    border: 1px solid rgba(53,150,255,0.25);
    background:
        linear-gradient(120deg, rgba(17,104,193,0.24), rgba(12,25,42,0.7));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.upload-inner h2 {
    font-size: 32px;
    margin: 9px 0;
}

.upload-inner p {
    color: #8ca3be;
    margin: 0;
    max-width: 600px;
}


/* ADS */

.ad-section {
    max-width: 1100px;
    margin: 30px auto 70px;
    padding: 0 24px;
}

.ad-label {
    text-align: center;
    color: #415872;
    font-size: 9px;
    letter-spacing: 0.15em;
    margin-bottom: 7px;
}

.ad-container {
    min-height: 90px;
    border: 1px dashed rgba(255,255,255,0.06);
    border-radius: 10px;
}


/* MODALS */

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(7px);
}

.modal-box {
    position: relative;
    z-index: 2;
    width: min(480px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    background: #0b1829;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 30px 100px rgba(0,0,0,0.5);
}

.upload-modal {
    width: min(650px, 100%);
}

.modal-close {
    position: absolute;
    right: 17px;
    top: 13px;
    background: transparent;
    border: 0;
    color: #70859d;
    font-size: 28px;
    cursor: pointer;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-header img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    margin-bottom: 18px;
}

.modal-header h2 {
    margin: 7px 0;
    font-size: 28px;
}

.modal-header p {
    color: #7e94ad;
    line-height: 1.5;
    margin: 0;
}


/* FORMS */

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 12px;
    color: #b7c8da;
    font-weight: 700;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: #071322;
    color: white;
    border: 1px solid rgba(255,255,255,0.11);
    border-radius: 9px;
    outline: none;
    padding: 12px 13px;
}

.form-group textarea {
    resize: vertical;
    min-height: 90px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #238cff;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #617991;
    font-size: 11px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-switch {
    text-align: center;
    margin-top: 18px;
    color: #7289a2;
    font-size: 13px;
}

.auth-switch button {
    border: 0;
    background: transparent;
    color: #3d9aff;
    cursor: pointer;
    font-weight: 700;
}

.form-message {
    margin: 12px 0 0;
    text-align: center;
    font-size: 13px;
    color: #ff9b9b;
}

.upload-progress {
    margin-bottom: 18px;
}

.upload-progress.hidden {
    display: none;
}

.progress-bar {
    height: 6px;
    border-radius: 20px;
    background: #071322;
    overflow: hidden;
}

#progressFill {
    height: 100%;
    width: 0%;
    background: #218cff;
    transition: width 0.2s;
}

#progressText {
    display: block;
    margin-top: 7px;
    color: #7890ab;
    font-size: 11px;
}


/* TOAST */

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2000;
    max-width: 350px;
    padding: 14px 17px;
    background: #10253b;
    color: white;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.35);
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}


/* FOOTER */

.site-footer {
    border-top: 1px solid rgba(255,255,255,0.07);
    background: #050d18;
    padding: 35px 24px;
}

.footer-inner {
    max-width: 1250px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 30px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.footer-brand img {
    width: 34px;
    height: 34px;
}

.footer-brand strong,
.footer-brand span {
    display: block;
}

.footer-brand span {
    color: #617891;
    font-size: 11px;
    margin-top: 3px;
}

.footer-links {
    display: flex;
    gap: 20px;
    color: #7890a9;
    font-size: 13px;
}

.footer-inner > p {
    color: #526a84;
    font-size: 11px;
}


/* ACCOUNT */

.account-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-name {
    color: #aec1d5;
    font-size: 13px;
}

.sign-out-button {
    background: rgba(255,255,255,0.06);
    color: #a5b8cd;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 12px;
}


/* MOBILE */

@media (max-width: 850px) {

    .header-inner {
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

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

    .library-heading {
        align-items: start;
        flex-direction: column;
    }

    .upload-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}


@media (max-width: 560px) {

    .hero {
        padding-top: 55px;
    }

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

    .category-grid,
    .schematic-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .library-controls {
        width: 100%;
    }

    .library-controls select {
        flex: 1;
    }

    .brand {
        min-width: 0;
    }

    .header-inner {
        gap: 14px;
    }

    .main-nav {
        gap: 14px;
    }

    .upload-inner {
        padding: 28px;
    }

    .modal-box {
        padding: 23px;
    }
}

/* DONUTBASE - account creation removed */
#accountArea {
    display: flex;
    align-items: center;
}

#loginButton {
    white-space: nowrap;
}
