:root {
    --bg: #080c1b;
    --bg-soft: #11172d;
    --card: rgba(255, 255, 255, 0.86);
    --card-dark: rgba(10, 15, 30, 0.6);
    --text: #0f172a;
    --text-light: #5b6479;
    --accent: #6d5efc;
    --accent-2: #00c5ff;
    --success: #198754;
    --radius-xl: 24px;
    --radius-lg: 16px;
    --shadow-soft: 0 20px 45px rgba(8, 14, 36, 0.18);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: #e9ecf7;
    background:
        radial-gradient(circle at 20% -20%, #283669 0%, transparent 50%),
        radial-gradient(circle at 90% 0%, rgba(0, 197, 255, 0.22) 0%, transparent 40%),
        var(--bg);
    min-height: 100vh;
}

.smart-page {
    position: relative;
    z-index: 2;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(75px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}

.bg-orb-1 {
    width: 260px;
    height: 260px;
    background: #5f64ff;
    top: 5%;
    left: -4%;
}

.bg-orb-2 {
    width: 340px;
    height: 340px;
    background: #00c5ff;
    right: -8%;
    bottom: 8%;
}

.shadow-soft {
    box-shadow: var(--shadow-soft);
}

.hero-card,
.tool-shell {
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.93), rgba(246, 248, 255, 0.9));
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    background: rgba(17, 23, 45, 0.08);
    color: #223;
    font-size: 0.84rem;
    font-weight: 700;
}

.hero-lead {
    font-size: 1.14rem;
    max-width: 60ch;
}

.hero-stat-grid {
    display: grid;
    gap: 0.75rem;
}

.hero-stat {
    background: rgba(7, 12, 28, 0.05);
    border: 1px solid rgba(7, 12, 28, 0.08);
    border-radius: 14px;
    padding: 0.8rem 0.95rem;
}

.hero-stat-label {
    display: block;
    font-size: 0.78rem;
    color: #667085;
    margin-bottom: 0.2rem;
}

.section-title h2 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title p {
    margin: 0;
    color: var(--text-light);
}

.drop-zone {
    position: relative;
    border: 2px dashed rgba(109, 94, 252, 0.45);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(109, 94, 252, 0.06), rgba(0, 197, 255, 0.07));
    padding: 2rem 1rem;
    text-align: center;
    transition: all 0.22s ease;
    cursor: pointer;
}

.drop-zone:hover,
.drop-zone.is-dragover,
.drop-zone:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 12px 32px rgba(109, 94, 252, 0.18);
    outline: none;
}

.drop-zone i {
    font-size: 2rem;
    color: var(--accent);
}

.drop-zone h3 {
    margin-top: 0.65rem;
    font-size: 1.08rem;
    font-weight: 700;
}

.drop-zone p {
    color: var(--text-light);
    margin-bottom: 0;
}

.size-pill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.65rem;
}

.size-pill {
    position: relative;
}

.size-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.size-pill span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 52px;
    border-radius: 13px;
    border: 1px solid rgba(17, 23, 45, 0.12);
    background: #ffffff;
    font-weight: 700;
    transition: all 0.18s ease;
}

.size-pill input:checked + span {
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 12px 20px rgba(59, 76, 190, 0.24);
}

.custom-size-panel {
    border: 1px solid rgba(17, 23, 45, 0.11);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: #fff;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.size-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(109, 94, 252, 0.1);
    color: #353566;
    border: 1px solid rgba(109, 94, 252, 0.2);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-weight: 600;
    font-size: 0.87rem;
}

.size-chip button {
    border: 0;
    background: none;
    color: inherit;
    line-height: 1;
}

.option-card {
    border: 1px solid rgba(17, 23, 45, 0.11);
    border-radius: var(--radius-lg);
    background: #fff;
    padding: 1rem;
}

.option-toggle,
.option-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
}

.option-toggle:hover,
.option-check:hover {
    background: rgba(17, 23, 45, 0.04);
}

.option-toggle input,
.option-check input {
    accent-color: var(--accent);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}

.preview-card {
    border-radius: 16px;
    border: 1px solid rgba(17, 23, 45, 0.1);
    background: #fff;
    overflow: hidden;
    animation: riseIn 0.24s ease;
}

.preview-card img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    background: repeating-linear-gradient(
        45deg,
        #f2f4ff,
        #f2f4ff 10px,
        #ebefff 10px,
        #ebefff 20px
    );
}

.preview-meta {
    padding: 0.75rem;
}

.preview-meta h4 {
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
    word-break: break-word;
}

.preview-meta p {
    margin: 0;
    font-size: 0.8rem;
    color: #5f677e;
}

.preview-remove {
    border: 0;
    border-top: 1px solid rgba(17, 23, 45, 0.08);
    width: 100%;
    padding: 0.5rem;
    font-weight: 600;
    color: #a02929;
    background: #fff;
}

.preview-remove:hover {
    background: #fff4f4;
}

.empty-state {
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(17, 23, 45, 0.16);
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.6);
}

.empty-state i {
    font-size: 2rem;
    color: #6f7a93;
}

.empty-state h3 {
    font-size: 1.05rem;
    margin-top: 0.45rem;
    margin-bottom: 0.15rem;
}

.empty-state p {
    color: #6b7284;
    margin-bottom: 0;
}

.action-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(11, 17, 37, 0.96), rgba(33, 45, 87, 0.95));
    color: #f8f9ff;
}

.result-panel {
    border: 1px solid rgba(18, 139, 81, 0.22);
    background: linear-gradient(180deg, rgba(228, 250, 240, 0.9), rgba(243, 253, 248, 0.95));
    border-radius: var(--radius-lg);
    padding: 1rem;
    color: #15331f;
}

.result-file-list {
    max-height: 240px;
    overflow: auto;
    margin: 0.8rem 0 0;
    padding: 0.2rem 0;
}

.result-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    padding: 0.45rem 0.5rem;
    border-radius: 10px;
}

.result-file-item:nth-child(odd) {
    background: rgba(255, 255, 255, 0.46);
}

.badge-soft {
    font-size: 0.82rem;
    color: #2c3351;
    background: rgba(17, 23, 45, 0.09);
    border: 1px solid rgba(17, 23, 45, 0.11);
    border-radius: 999px;
    padding: 0.35rem 0.62rem;
}

.btn-accent {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #5d4ff4;
    --bs-btn-hover-border-color: #5d4ff4;
    --bs-btn-focus-shadow-rgb: 109, 94, 252;
    --bs-btn-active-bg: #5445e7;
    --bs-btn-active-border-color: #5445e7;
}

.btn-outline-accent {
    --bs-btn-color: #5d52ca;
    --bs-btn-border-color: #7669fb;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #6659f7;
    --bs-btn-hover-border-color: #6659f7;
    --bs-btn-focus-shadow-rgb: 109, 94, 252;
}

.tool-footer {
    position: relative;
    z-index: 2;
    color: #c8d0ea;
    font-size: 0.92rem;
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: rgba(17, 23, 45, 0.13);
    min-height: 46px;
}

.form-control:focus,
.btn:focus-visible,
.size-pill span:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(109, 94, 252, 0.18);
    outline: none;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .hero-lead {
        max-width: 100%;
    }
}

@media (max-width: 575.98px) {
    .hero-card,
    .tool-shell {
        border-radius: 18px;
    }

    .drop-zone {
        padding: 1.4rem 0.8rem;
    }

    .action-panel {
        padding: 0.9rem;
    }
}
