* {
    box-sizing: border-box;
}

body {

    margin: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: #f3f4f6;

    color: #111827;
}

header {

    background: #111827;

    color: white;

    padding:
        16px
        max(18px, env(safe-area-inset-right))
        16px
        max(18px, env(safe-area-inset-left));

    display: flex;

    justify-content: space-between;

    align-items: center;

    position: sticky;

    top: 0;

    z-index: 10;
}

.brand {

    display: flex;

    flex-direction: column;
}

.brand strong {

    font-size: 20px;
}

.brand span {

    font-size: 12px;

    opacity: .7;
}

.header-actions {

    display: flex;

    gap: 6px;

    align-items: center;
}

.header-actions button,
.language button {

    background: transparent;

    border: 0;

    color: inherit;

    padding: 6px;

    cursor: pointer;
}

.logout {

    color: white;

    text-decoration: none;

    font-size: 20px;

    margin-left: 8px;
}

.container {

    max-width: 720px;

    margin: auto;

    padding: 20px 16px 50px;
}

.hero {

    padding: 8px 2px 18px;
}

.hero h1 {

    margin: 0 0 6px;

    font-size: 25px;
}

.hero p {

    margin: 0;

    color: #6b7280;
}

.card {

    background: white;

    border-radius: 18px;

    padding: 20px;

    margin-bottom: 18px;

    box-shadow:
        0 4px 20px rgba(0,0,0,.05);
}

label {

    display: block;

    font-weight: 600;

    margin: 0 0 9px;
}

.category-grid {

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 8px;

    margin-bottom: 20px;
}

.category {

    border: 1px solid #d1d5db;

    background: white;

    border-radius: 12px;

    padding: 12px 6px;

    font-weight: 600;

    cursor: pointer;
}

.category small {

    display: block;

    color: #6b7280;

    margin-top: 4px;
}

.category.active {

    border-color: #111827;

    background: #111827;

    color: white;
}

.category.active small {

    color: #d1d5db;
}

.fields {

    display: grid;

    gap: 14px;

    margin-bottom: 20px;
}

input {

    width: 100%;

    border:
        1px solid #d1d5db;

    border-radius: 10px;

    padding: 13px;

    font-size: 16px;

    outline: none;
}

input:focus {

    border-color: #111827;
}

.upload {

    border:
        2px dashed #d1d5db;

    border-radius: 16px;

    min-height: 190px;

    display: flex;

    justify-content: center;

    align-items: center;

    text-align: center;

    cursor: pointer;

    padding: 15px;

    position: relative;

    overflow: hidden;
}

.upload input {

    display: none;
}

.camera {

    font-size: 42px;

    margin-bottom: 8px;
}

.upload strong,
.upload span {

    display: block;
}

.upload span {

    font-size: 12px;

    color: #6b7280;

    margin-top: 6px;
}

.preview {

    max-width: 100%;

    max-height: 300px;

    border-radius: 12px;
}

.primary {

    width: 100%;

    background: #111827;

    color: white;

    border: none;

    border-radius: 12px;

    padding: 15px;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;
}

.analyze {

    margin-top: 18px;
}

.primary:disabled {

    opacity: .5;

    cursor: not-allowed;
}

.loading {

    display: none;

    justify-content: center;

    align-items: center;

    gap: 10px;

    margin-top: 18px;

    color: #4b5563;
}

.spinner {

    width: 18px;

    height: 18px;

    border:
        3px solid #e5e7eb;

    border-top-color: #111827;

    border-radius: 50%;

    animation:
        spin 1s linear infinite;
}

@keyframes spin {

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

.result h2 {

    margin-top: 0;
}

.result-block {

    border-top:
        1px solid #e5e7eb;

    padding-top: 16px;

    margin-top: 16px;
}

.result-block h3,
.risk h3 {

    font-size: 14px;

    color: #6b7280;

    margin: 0 0 8px;
}

.big {

    font-size: 22px;

    font-weight: 800;
}

ul {

    padding-left: 20px;
}

li {

    margin-bottom: 8px;

    line-height: 1.5;
}

.risk {

    margin-top: 20px;

    border-radius: 14px;

    padding: 16px;

    background: #f3f4f6;
}

#riskLevel {

    font-size: 22px;

    font-weight: 900;
}

.risk-high {

    color: #dc2626;
}

.risk-critical {

    color: #991b1b;
}

.risk-medium {

    color: #d97706;
}

.risk-low {

    color: #16a34a;
}

.language {

    position: fixed;

    top: 12px;

    right: 15px;

    z-index: 20;
}

.login-container {

    max-width: 420px;

    margin:
        18vh auto
        0;

    padding: 25px;

    background: white;

    border-radius: 18px;

    box-shadow:
        0 8px 35px rgba(0,0,0,.08);
}

.logo {

    font-size: 30px;

    font-weight: 900;

    text-align: center;
}

.subtitle {

    text-align: center;

    color: #6b7280;

    margin:
        8px 0
        30px;
}

.login-container .primary {

    margin-top: 20px;
}

.error {

    color: #dc2626;

    margin-top: 12px;

    line-height: 1.5;
}

footer {

    text-align: center;

    color: #9ca3af;

    font-size: 12px;

    padding-bottom: 30px;
}

@media (min-width: 650px) {

    .fields {

        grid-template-columns:
            repeat(2, 1fr);
    }
}
