* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #eef4ff, #f8fbff);
    color: #162033;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px;
}

.card {
    width: 100%;
    max-width: 700px;
    background: #ffffff;
    border-radius: 22px;
    padding: 26px;
    box-shadow: 0 16px 38px rgba(15, 35, 75, 0.11);
}

.brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    margin-top: 2px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.brand-text h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.1;
}

.brand-eye {
    color: #1f4e79;
}

.brand-text p {
    margin: 6px 0 0;
    color: #526174;
    line-height: 1.35;
    font-size: 14px;
}

h1 {
    margin: 0;
    font-size: 26px;
}

p {
    line-height: 1.5;
}

.trial-notice {
    margin: 0 0 14px;
    padding: 12px 16px;
    background: #f6f9ff;
    border: 1px solid #d8e3f2;
    border-radius: 14px;
    color: #526174;
    font-size: 14px;
    line-height: 1.4;
}

.trial-ok {
    background: #eefbf4;
    border-color: #bde8cc;
    color: #276749;
}

.access-form {
    display: flex;
    gap: 10px;
    margin: 0 0 18px;
    width: 100%;
}

.access-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d8e3f2;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    color: #162033;
}

.access-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 12px 18px;
    font-size: 14px;
    border-radius: 12px;
    white-space: nowrap;
}

.upload-form {
    display: grid;
    gap: 16px;
}

.upload-box {
    border: 2px dashed #9cb7d8;
    background: #f6f9ff;
    padding: 26px;
    border-radius: 18px;
    cursor: pointer;
    text-align: center;
    display: grid;
    gap: 10px;
}

.upload-title {
    font-size: 18px;
    font-weight: 700;
}

.upload-text {
    color: #526174;
    font-size: 14px;
    line-height: 1.35;
}

input[type="file"] {
    margin: 10px auto 0;
    max-width: 100%;
}

.file-count {
    margin: 10px 0 0;
    font-size: 14px;
    color: #526174;
    font-weight: 700;
}

.camera-input {
    display: none;
}

button,
.download-btn {
    appearance: none;
    border: none;
    background: #1f4e79;
    color: white;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-block;
    width: 100%;
}

button:hover,
.download-btn:hover {
    background: #173d5f;
}

.camera-btn {
    background: #276749;
}

.camera-btn:hover {
    background: #1f5139;
}

button[disabled] {
    opacity: 0.75;
    cursor: not-allowed;
}

.downloads {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.download-btn.secondary {
    background: #526174;
}

.download-btn.secondary:hover {
    background: #394555;
}

.info {
    margin-top: 26px;
    background: #f8fbff;
    border-radius: 18px;
    padding: 18px;
}

.info h2 {
    margin-top: 0;
}

.info li {
    margin-bottom: 8px;
}

.alert {
    background: #f6f9ff;
    border: 1px solid #d8e3f2;
    color: #526174;
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 20px;
}

.legal {
    margin-top: 24px;
    font-size: 13px;
    color: #6b7788;
}

.powered-by {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7788;
    text-align: center;
    font-weight: 600;
}

.back-link {
    display: inline-block;
    margin-top: 24px;
    color: #1f4e79;
    font-weight: 700;
    text-decoration: none;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 32, 51, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.loading-overlay.hidden {
    display: none;
}

.loading-box {
    width: 100%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 22px;
    padding: 34px 28px;
    text-align: center;
    box-shadow: 0 18px 45px rgba(15, 35, 75, 0.18);
}

.loading-box h2 {
    margin: 18px 0 10px;
    font-size: 28px;
}

.loading-box p {
    margin: 0;
    color: #526174;
}

.spinner {
    width: 72px;
    height: 72px;
    margin: 0 auto;
    border: 7px solid #d8e3f2;
    border-top: 7px solid #1f4e79;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 620px) {
    .page {
        min-height: auto;
        padding: 10px;
    }

    .card {
        max-width: 100%;
        border-radius: 20px;
        padding: 18px;
    }

    .brand {
        gap: 10px;
        margin-bottom: 14px;
    }

    .brand-icon {
        width: 48px;
        height: 48px;
        margin-top: 2px;
    }

    .brand-text h1 {
        font-size: 24px;
    }

    .brand-text p {
        font-size: 13px;
        line-height: 1.3;
    }

    .trial-notice {
        margin-bottom: 10px;
        padding: 10px 12px;
        font-size: 13px;
        line-height: 1.35;
    }

    .access-form {
        display: grid;
        gap: 8px;
        margin-bottom: 12px;
    }

    .access-form input {
        width: 100%;
        min-width: 0;
        padding: 11px 12px;
        font-size: 14px;
    }

    .access-btn {
        width: 100%;
        padding: 11px 12px;
        font-size: 14px;
        white-space: normal;
    }

    .upload-form {
        gap: 12px;
    }

    .upload-box {
        padding: 18px 14px;
        border-radius: 16px;
        gap: 8px;
    }

    .upload-title {
        font-size: 17px;
        line-height: 1.15;
    }

    .upload-text {
        font-size: 13px;
        line-height: 1.25;
    }

    input[type="file"] {
        margin-top: 10px;
        font-size: 13px;
    }

    .file-count {
        margin-top: 8px;
        font-size: 13px;
        line-height: 1.35;
    }

    button,
    .download-btn {
        padding: 13px 16px;
        border-radius: 13px;
        font-size: 15px;
    }

    .info {
        margin-top: 20px;
        padding: 16px;
        border-radius: 16px;
    }

    .info h2 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .info ul {
        padding-left: 18px;
        margin: 0;
    }

    .info li {
        margin-bottom: 6px;
        font-size: 13px;
        line-height: 1.35;
    }

    .legal {
        margin-top: 18px;
        font-size: 12px;
        line-height: 1.35;
    }

    .powered-by {
        margin-top: 8px;
        font-size: 12px;
    }
}

@supports (-webkit-touch-callout: none) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        -webkit-text-size-adjust: 100%;
    }

    .page,
    .card,
    .brand,
    .brand-text,
    .upload-form,
    .upload-box,
    .info,
    .trial-notice,
    .access-form {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .card {
        overflow: hidden;
    }

    .brand-text p,
    .trial-notice,
    .file-count,
    .upload-title,
    .upload-text {
        overflow-wrap: anywhere;
        word-break: normal;
    }
}
