@font-face {
    font-family: "Porto Roobert";
    src: url("../fonts/PortoRoobert-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Porto Roobert";
    src: url("../fonts/PortoRoobert-SemiBold.otf") format("opentype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Porto Roobert";
    src: url("../fonts/PortoRoobert-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --porto-blue: #004b8d;
    --porto-blue-dark: #003366;
    --porto-blue-light: #0078c8;
    --porto-sky: #4db4ff;
    --porto-yellow: #f5c400;
    --white: #ffffff;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Porto Roobert", "Segoe UI", Arial, sans-serif;
    color: var(--white);
    background: linear-gradient(180deg, #0057a8 0%, #004b8d 45%, #003f78 100%);
}

body {
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 32px;
    position: relative;
    overflow-x: hidden;
}

.page::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 12%, rgba(255, 255, 255, 0.08), transparent 24%),
        radial-gradient(circle at 10% 80%, rgba(255, 255, 255, 0.05), transparent 30%);
    pointer-events: none;
}

.content {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.logo-image {
    width: 58px;
    height: 81px;
    display: block;
}

.hero {
    text-align: center;
    margin-bottom: 28px;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-tagline {
    margin: 0;
    font-size: clamp(2.4rem, 10vw, 3.4rem);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero-joga {
    color: #ffe14d;
    text-shadow:
        2px 2px 0 #1f9b4d,
        -1px -1px 0 #1f9b4d,
        0 4px 10px rgba(0, 0, 0, 0.25);
}

.hero-junto {
    color: #8fd3ff;
    text-shadow:
        2px 2px 0 #1f9b4d,
        -1px -1px 0 #1f9b4d,
        0 4px 10px rgba(0, 0, 0, 0.25);
}

.card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    padding: 24px 20px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    font-weight: 600;
}

.field input[type="text"],
.field input[type="email"] {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 1rem;
    color: #1f2937;
    background: var(--white);
}

.field input[type="text"]::placeholder,
.field input[type="email"]::placeholder {
    color: #9ca3af;
}

.page-login {
    justify-content: flex-start;
    padding-top: 20px;
}

.content-login {
    max-width: 390px;
}

.login-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.login-header-logo {
    width: 58px;
    height: auto;
    display: block;
}

.hero-login {
    margin-bottom: 36px;
}

.hero-brand {
    width: min(100%, 340px);
    height: auto;
    display: block;
    margin: 0 auto;
    mix-blend-mode: lighten;
}

.login-form .field {
    margin-bottom: 16px;
}

.login-form .btn-primary {
    margin-top: 8px;
    border-radius: 16px;
    padding: 18px 20px;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.login-alert {
    display: block;
    margin-bottom: 16px;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 18px 0 22px;
    font-size: 0.88rem;
    line-height: 1.4;
}

.checkbox-row input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    accent-color: var(--porto-blue-light);
}

.checkbox-row a {
    color: var(--porto-yellow);
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(180deg, #0094ef 0%, #0078c8 100%);
    color: var(--white);
    box-shadow: 0 8px 18px rgba(0, 120, 200, 0.35);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.85);
}

.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.photo-box {
    width: 100%;
    aspect-ratio: 3 / 3;
    border: 2px dashed rgba(255, 255, 255, 0.75);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.photo-box img,
.photo-box video,
.photo-box canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-placeholder {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.alert {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    font-size: 0.92rem;
    display: none;
}

.alert.show {
    display: block;
}

.alert.error {
    border-left: 4px solid #dc2626;
}

.alert.success {
    border-left: 4px solid #16a34a;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 40, 80, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 24px;
}

.loading-overlay.show {
    display: flex;
}

.loading-card {
    width: min(100%, 360px);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    backdrop-filter: blur(10px);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--white);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-card {
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.result-card img {
    display: block;
    width: 100%;
    height: auto;
}

.result-actions {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.body-result {
    background: #ffffff;
    color: #0f2f57;
}

.page-result,
.page-download {
    padding-top: 18px;
}

.content-result,
.content-download {
    max-width: 430px;
}

.result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.result-header-brand {
    width: min(48vw, 130px);
    height: auto;
    mix-blend-mode: multiply;
}

.page-download .result-header-brand {
    mix-blend-mode: lighten;
}

.result-header-logo {
    width: 58px;
    height: auto;
    flex-shrink: 0;
}

.result-intro,
.download-intro {
    text-align: center;
    margin-bottom: 22px;
}

.result-intro h1,
.download-intro h1 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 1.9rem);
    font-weight: 700;
    color: inherit;
}

.page-result .result-intro h1 {
    color: #0f2f57;
}

.page-download .download-intro h1 {
    color: #ffffff;
}

.result-preview,
.download-preview {
    background: #d9ecfb;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.result-preview img,
.download-preview img {
    display: block;
    width: 100%;
    height: auto;
}

.feedback-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.btn-feedback {
    min-height: 54px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.btn-feedback-like {
    background: linear-gradient(180deg, #0094ef 0%, #0078c8 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(0, 120, 200, 0.28);
}

.btn-feedback-dislike {
    background: #ffffff;
    color: #0078c8;
    border: 2px solid #0078c8;
}

.page-download {
    background: linear-gradient(180deg, #0057a8 0%, #004b8d 45%, #003f78 100%);
    color: #ffffff;
}

.btn-download {
    margin-bottom: 28px;
    border-radius: 16px;
    padding: 18px 20px;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.btn-icon {
    display: inline-flex;
    margin-right: 8px;
    font-size: 1.05rem;
    line-height: 1;
}

.share-section {
    text-align: center;
}

.share-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 600;
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.share-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

@media (min-width: 768px) {
    .content {
        max-width: 460px;
    }

    .hero h1 {
        font-size: 1.9rem;
    }
}
