@import url(
'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap'
);

:root {
    --primary: #6957ff;
    --primary-dark: #5442e8;
    --primary-light: #f0edff;
    --secondary: #151827;
    --text: #181a24;
    --text-muted: #737688;
    --border: #e6e7ed;
    --background: #f7f8fc;
    --white: #ffffff;
    --danger: #d94747;
    --danger-background: #fff0f0;
    --success: #198754;
    --success-background: #eafaf1;
    --shadow: 0 24px 70px rgba(35, 31, 80, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--background);
}

button,
input {
    font: inherit;
}

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

.page-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background:
            linear-gradient(
                    135deg,
                    #fbfbff 0%,
                    #f4f3ff 45%,
                    #f8f9fd 100%
            );
}

.background-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(5px);
}

.circle-one {
    width: 520px;
    height: 520px;
    top: -230px;
    right: -100px;
    background: rgba(105, 87, 255, 0.13);
}

.circle-two {
    width: 450px;
    height: 450px;
    bottom: -260px;
    left: -150px;
    background: rgba(91, 197, 255, 0.12);
}

.page-container {
    width: min(1180px, calc(100% - 40px));
    min-height: 100vh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.page-header {
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 38px;
    height: 38px;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    border-radius: 11px;
    background: var(--secondary);
    box-shadow: 0 8px 20px rgba(21, 24, 39, 0.2);
}

.logo-icon span {
    display: block;
    border-radius: 2px;
    background: var(--white);
}

.logo-icon span:last-child {
    background: var(--primary);
}

.header-badge {
    padding: 9px 15px;
    border: 1px solid rgba(105, 87, 255, 0.16);
    border-radius: 999px;
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.hero-section {
    flex: 1;
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
    gap: 70px;
    padding: 50px 0 70px;
}

.hero-text {
    max-width: 520px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
}

.hero-text h1 {
    margin: 0;
    color: var(--secondary);
    font-size: clamp(46px, 5vw, 72px);
    line-height: 1.02;
    letter-spacing: -4px;
}

.hero-text h1 span {
    color: var(--primary);
}

.hero-text p {
    max-width: 470px;
    margin: 26px 0 0;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1.8;
}

.generator-card {
    width: 100%;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 28px;
    padding: 6px;
    border-radius: 16px;
    background: #f1f2f7;
}

.type-button {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    color: var(--text-muted);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
    transition: 0.25s ease;
}

.type-button:hover {
    color: var(--primary);
}

.type-button.active {
    color: var(--secondary);
    background: var(--white);
    box-shadow: 0 6px 18px rgba(35, 31, 80, 0.08);
}

.button-icon {
    font-size: 18px;
}

.input-section {
    animation: fadeIn 0.25s ease;
}

.drop-zone {
    min-height: 245px;
    padding: 35px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 2px dashed #d7d5e8;
    border-radius: 20px;
    text-align: center;
    cursor: pointer;
    background: #fafaff;
    transition: 0.25s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.upload-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: var(--primary);
    background: var(--primary-light);
    font-size: 27px;
    font-weight: 700;
}

.drop-zone h3 {
    margin: 0 0 9px;
    font-size: 18px;
}

.drop-zone p {
    margin: 0 0 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.drop-zone p span {
    color: var(--primary);
    font-weight: 700;
}

.drop-zone small,
.input-help {
    color: #9a9cab;
    font-size: 12px;
}

.selected-file {
    margin-top: 15px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fafafe;
}

.file-icon {
    width: 43px;
    height: 43px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--primary-light);
}

.file-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-info strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info span {
    color: var(--text-muted);
    font-size: 12px;
}

.remove-file-button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    color: var(--text-muted);
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.remove-file-button:hover {
    color: var(--danger);
    background: var(--danger-background);
}

.input-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
}

.url-input-wrapper {
    height: 60px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #fafafe;
    transition: 0.2s ease;
}

.url-input-wrapper:focus-within {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(105, 87, 255, 0.1);
}

.url-prefix {
    color: var(--primary);
    font-size: 18px;
}

.url-input-wrapper input {
    width: 100%;
    height: 100%;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
}

.input-help {
    display: block;
    margin-top: 10px;
}

.generate-button {
    width: 100%;
    min-height: 58px;
    margin-top: 24px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    border-radius: 15px;
    color: var(--white);
    background:
            linear-gradient(
                    135deg,
                    var(--primary),
                    #8c63ff
            );
    box-shadow: 0 14px 30px rgba(105, 87, 255, 0.3);
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 35px rgba(105, 87, 255, 0.38);
}

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

.message {
    margin-top: 16px;
    padding: 13px 15px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.error-message {
    color: var(--danger);
    background: var(--danger-background);
}

.result-section {
    animation: fadeIn 0.35s ease;
}

.success-badge {
    margin-bottom: 23px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--success);
    font-size: 13px;
    font-weight: 700;
}

.success-badge span {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--success-background);
}

.qr-result {
    display: grid;
    grid-template-columns: 190px 1fr;
    align-items: center;
    gap: 28px;
}

.qr-image-container {
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--white);
    box-shadow: 0 12px 30px rgba(35, 31, 80, 0.08);
}

.qr-image-container img {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.result-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-details h3 {
    max-width: 310px;
    margin: 8px 0 10px;
    overflow-wrap: anywhere;
    font-size: 20px;
}

.result-details p {
    margin: 18px 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.result-type span,
.result-type {
    display: inline-flex;
}

.result-type span {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--primary-dark);
    background: var(--primary-light);
    font-size: 11px;
    font-weight: 800;
}

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

.secondary-button {
    padding: 11px 16px;
    border-radius: 11px;
    color: var(--white);
    background: var(--secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.text-button {
    border: 0;
    color: var(--primary);
    background: transparent;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.page-footer {
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(80, 82, 105, 0.1);
    color: var(--text-muted);
    font-size: 12px;
}

.page-footer span:first-child {
    color: var(--secondary);
    font-weight: 700;
}

.loader {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 950px) {
    .hero-section {
        grid-template-columns: 1fr;
        gap: 45px;
        padding-top: 35px;
    }

    .hero-text {
        max-width: 650px;
        text-align: center;
        margin: 0 auto;
    }

    .hero-text p {
        margin-right: auto;
        margin-left: auto;
    }

    .hero-text h1 {
        letter-spacing: -3px;
    }
}

@media (max-width: 620px) {
    .page-container {
        width: min(100% - 24px, 1180px);
    }

    .page-header {
        min-height: 75px;
    }

    .header-badge {
        display: none;
    }

    .hero-section {
        padding: 25px 0 50px;
    }

    .hero-text h1 {
        font-size: 42px;
        letter-spacing: -2.5px;
    }

    .hero-text p {
        font-size: 15px;
    }

    .generator-card {
        padding: 20px;
        border-radius: 22px;
    }

    .drop-zone {
        min-height: 215px;
    }

    .qr-result {
        grid-template-columns: 1fr;
    }

    .qr-image-container {
        width: min(220px, 100%);
        margin: 0 auto;
    }

    .result-details {
        text-align: center;
    }

    .result-details h3 {
        margin-right: auto;
        margin-left: auto;
    }

    .result-type {
        justify-content: center;
    }

    .result-actions {
        justify-content: center;
    }

    .page-footer {
        gap: 10px;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .page-footer {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }

    .footer-divider {
        color: #b0b7c3;
    }

    .footer-brand {
        color: #6b7280;
        font-size: 14px;
    }

    .footer-brand strong {
        color: #2563eb;
        font-weight: 700;
    }
}

/* =========================================================
   QR unavailable page
   ========================================================= */

.qr-error-page {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
}

.qr-error-container {
    position: relative;
    z-index: 1;

    width: min(100% - 40px, 720px);
    min-height: 100vh;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 60px 0 30px;
    box-sizing: border-box;
}

.qr-error-card {
    width: 100%;
    padding: 55px 50px;

    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 28px;

    box-shadow:
            0 30px 70px rgba(27, 35, 71, 0.14),
            0 8px 24px rgba(27, 35, 71, 0.08);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    text-align: center;
    box-sizing: border-box;
}

.qr-error-icon-wrapper {
    width: 92px;
    height: 92px;
    margin: 0 auto 26px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background:
            linear-gradient(
                    135deg,
                    rgba(255, 86, 86, 0.16),
                    rgba(255, 86, 86, 0.06)
            );

    border: 1px solid rgba(220, 53, 69, 0.18);
}

.qr-error-icon {
    width: 52px;
    height: 52px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #dc3545;
    color: #ffffff;

    font-size: 34px;
    font-weight: 300;
    line-height: 1;
}

.qr-error-eyebrow {
    display: inline-block;
    margin-bottom: 14px;

    color: #dc3545;

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
}

.qr-error-card h1 {
    max-width: 540px;
    margin: 0 auto 18px;

    color: #18203a;

    font-size: clamp(30px, 5vw, 44px);
    line-height: 1.12;
    letter-spacing: -1.2px;
}

.qr-error-description {
    max-width: 530px;
    margin: 0 auto;

    color: #667085;

    font-size: 16px;
    line-height: 1.7;
}

.qr-error-info {
    margin: 32px 0;
    padding: 18px 20px;

    display: flex;
    align-items: flex-start;
    gap: 14px;

    border: 1px solid #e8ebf2;
    border-radius: 16px;

    background: #f8f9fc;

    text-align: left;
}

.qr-error-info-icon {
    flex-shrink: 0;

    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #ecefff;
    color: #5d62d5;

    font-size: 14px;
    font-weight: 800;
}

.qr-error-info strong {
    display: block;
    margin-bottom: 5px;

    color: #27304a;
    font-size: 14px;
}

.qr-error-info p {
    margin: 0;

    color: #737b8f;

    font-size: 13px;
    line-height: 1.55;
}

.qr-error-home-button {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    text-decoration: none;
    box-sizing: border-box;
}

.qr-error-reference {
    margin-top: 25px;

    color: #98a0b3;

    font-size: 12px;
    letter-spacing: 0.3px;
}

.qr-error-reference strong {
    color: #747d93;
}

.qr-error-footer {
    margin-top: 30px;
}

@media (max-width: 650px) {
    .qr-error-container {
        width: min(100% - 28px, 720px);
        padding-top: 30px;
    }

    .qr-error-card {
        padding: 42px 24px;
        border-radius: 22px;
    }

    .qr-error-icon-wrapper {
        width: 80px;
        height: 80px;
    }

    .qr-error-icon {
        width: 46px;
        height: 46px;
        font-size: 30px;
    }

    .qr-error-info {
        padding: 16px;
    }

    .qr-error-footer {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* =========================================================
   Page header and logout
   ========================================================= */

.page-header {
    position: relative;
    z-index: 2;

    width: 100%;
    margin-bottom: 34px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 9px;

    color: #6f778d;

    font-size: 13px;
    font-weight: 600;
}

.header-brand-name {
    color: #202943;

    font-size: 15px;
    font-weight: 800;
}

.header-brand-divider {
    color: #a0a6b5;
}

.header-brand-product {
    color: #70788d;
}

.logout-form {
    margin: 0;
}

.logout-button {
    padding: 10px 16px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    background: rgba(255, 255, 255, 0.78);
    color: #535b72;

    border: 1px solid rgba(107, 114, 145, 0.2);
    border-radius: 12px;

    box-shadow:
            0 7px 18px rgba(31, 39, 77, 0.07);

    font: inherit;
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition:
            transform 0.2s ease,
            background 0.2s ease,
            border-color 0.2s ease,
            box-shadow 0.2s ease;
}

.logout-button:hover {
    background: #ffffff;

    border-color: rgba(103, 107, 216, 0.3);

    transform: translateY(-1px);

    box-shadow:
            0 10px 24px rgba(31, 39, 77, 0.11);
}

.logout-button:active {
    transform: translateY(0);
}

.logout-button:focus-visible {
    outline: 3px solid rgba(103, 107, 216, 0.18);
    outline-offset: 3px;
}

.logout-icon {
    font-size: 15px;
}

@media (max-width: 650px) {
    .page-header {
        margin-bottom: 26px;
    }

    .header-brand-product,
    .header-brand-divider {
        display: none;
    }

    .logout-button {
        padding: 9px 13px;
    }
}