/* Procarte Wheel of Fortune - Web Version Styles */
/* Dokładne odwzorowanie Android UI */

:root {
    /* Kolory Procarte - dokładnie jak w Android */
    --procarte-blue: #002C55;
    --procarte-blue-variant: #001B35;
    --procarte-green: #81A71E;
    --procarte-light-background: #F7FAFC;
    --procarte-light-blue: #008BD0;
    
    /* Kolory koła */
    --wheel-primary: #002C55;
    --wheel-sector-normal: #F7FAFC;
    --wheel-sector-winning: #81A71E;
    
    /* UI Colors */
    --text-primary: #000000;
    --text-secondary: #666666;
    --error-color: #DC3545;
    --border-color: #E0E0E0;
    --outline-color: #E6E6E6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--procarte-light-background);
    min-height: 100vh;
}

/* ===================== */
/* SPLIT BACKGROUND - 50/50 */
/* ===================== */
.split-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: flex;
    flex-direction: column;
}

.split-background .top {
    flex: 1;
    background-color: white;
}

.split-background .bottom {
    flex: 1;
    background-color: var(--procarte-blue);
}

/* ===================== */
/* CONTAINER */
/* ===================== */
.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* ===================== */
/* LANGUAGE SELECTOR - Chmurka z flagą */
/* ===================== */
.language-selector {
    background: url('../assets/cloud.svg') no-repeat center center;
    background-size: contain;
    position: absolute;
    top: 60px;
    right: 60px;
    width: 59px;
    height: 58px;
    cursor: pointer;
    z-index: 100;

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

.language-selector img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    /* Środek okręgu w SVG to (28.5, 28.5), a SVG ma 59x58 */
    /* Przesunięcie: w lewo o 1px, w górę o 1px */
    transform: translate(-1px, -1px);
}


.language-selector img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

/* ===================== */
/* WHEEL HEADER - Identyczny jak Android */
/* ===================== */
.wheel-header {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
}

/* Tło: "KOŁO FORTUNY" - tekst z białym wypełnieniem i szarym obramowaniem */
.background-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-40px) scaleX(1.2);
    font-size: 90px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    /* Tekst biały z szarym obramowaniem - dokładnie jak Android */
    color: white;
    -webkit-text-stroke: 3px #E6E6E6;
    paint-order: stroke fill;
    text-shadow: none;
}

/* Tekst na pierwszym planie: "Zakręć i wygraj" */
.action-text {
    position: relative;
    z-index: 1;
    padding: 60px 0;
}

.action-line1 {
    font-size: 56px;
    font-weight: 700;
    color: var(--procarte-green);
    line-height: 1.1;
}

.action-line2 {
    font-size: 56px;
    font-weight: 700;
    color: black;
    line-height: 1.1;
}

/* ===================== */
/* WHEEL CONTAINER */
/* ===================== */
.wheel-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
}

.wheel-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Logo trójkąt - na dole koła, wyśrodkowany */
.logo-triangle {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: auto;
    z-index: 10;
    pointer-events: none;
}

/* ===================== */
/* BOTTOM SECTION - Przycisk/tekst */
/* ===================== */
.bottom-section {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 20;
}

/* ===================== */
/* PRIMARY BUTTON - Prostokątny jak Android */
/* ===================== */
.btn-primary {
    background-color: var(--procarte-green);
    color: white;
    font-size: 28px;
    font-weight: 700;
    text-transform: none;
    padding: 20px 60px;
    border: none;
    border-radius: 0; /* Prostokątny! */
    cursor: pointer;
    min-width: 340px;
    height: 70px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #6f9118;
}

.btn-primary:active {
    background-color: #5a7614;
}

/* ===================== */
/* SPINNING TEXT */
/* ===================== */
.spinning-text {
    text-align: center;
}

.spinning-text .power {
    font-size: 32px;
    text-align: center;
}

.spinning-text .its {
    color: white;
    font-weight: 700;
}

.spinning-text .moc {
    color: var(--procarte-green);
    font-weight: 700;
}

.spinning-text .wait {
    font-size: 24px;
    font-weight: 300;
    color: white;
    margin-top: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===================== */
/* WINNING TEXT */
/* ===================== */
.winning-text {
    text-align: center;
}

.winning-text .congrats {
    font-size: 32px;
}

.winning-text .gratulujemy {
    color: var(--procarte-green);
    font-weight: 700;
}

.winning-text .otrzymujesz {
    color: white;
    font-weight: 700;
}

.winning-text .prize {
    font-size: 28px;
    font-weight: 300;
    color: white;
    margin-top: 8px;
}

/* ===================== */
/* VIEW CLASSES - SPA */
/* ===================== */
.view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ===================== */
/* HIDDEN CLASS */
/* ===================== */
.hidden {
    display: none !important;
}

/* ===================== */
/* FORM CONTAINER - Białe tło */
/* ===================== */
.form-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: white;
    position: relative;
}

.form-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 48px;
    padding-top: 300px; /* Miejsce na absolute nagłówek */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===================== */
/* FORM HEADER - Identyczny styl jak Wheel Header */
/* ===================== */
.form-header {
    position: absolute;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 10;
    width: 100%;
}

.step-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-40px) scaleX(1.2);
    font-size: 90px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-transform: uppercase;
    color: white;
    -webkit-text-stroke: 3px #E6E6E6;
    paint-order: stroke fill;
    text-shadow: none;
}

.step-title {
    position: relative;
    z-index: 1;
    padding: 60px 0;
}

.step-title .line1 {
    font-size: 56px;
    font-weight: 700;
    color: var(--procarte-green);
    line-height: 1.1;
}

.step-title .line2 {
    font-size: 56px;
    font-weight: 700;
    color: black;
    line-height: 1.1;
}

.step-indicator {
    display: none; /* Ukryte - w Android nie ma tego elementu na głównym widoku */
}

/* ===================== */
/* FORM FIELDS - 66% szerokości */
/* ===================== */
.form-fields {
    width: 66%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: black;
    font-size: 14px;
    margin-bottom: 4px;
    font-weight: 400;
}

.form-group input {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 0; /* Prostokątny! */
    padding: 16px;
    color: black;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--procarte-green);
}

.form-group input.error {
    border-color: var(--error-color);
}

.form-group input::placeholder {
    color: #999;
}

.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* ===================== */
/* NIP z przyciskiem GUS */
/* ===================== */
.form-group.with-gus {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    gap: 12px;
}

.form-group.with-gus .input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gus-button {
    background-color: var(--procarte-green);
    color: white;
    border: none;
    border-radius: 0;
    padding: 0 24px;
    height: 52px;
    min-width: 180px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background-color 0.3s;
}

.gus-button:hover {
    background-color: #6f9118;
}

/* ===================== */
/* ROW dla pól obok siebie */
/* ===================== */
.form-row {
    display: flex;
    gap: 24px;
}

.form-row .form-group {
    flex: 1;
}

/* ===================== */
/* CONSENTS SECTION */
/* ===================== */
.consents-section {
    margin-top: 8px;
}

.consents-title {
    color: black;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}


.consent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    background-color: transparent;
    border: 1px solid transparent;
    margin-bottom: 4px;
    transition: border-color 0.3s;
}

.consent-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    accent-color: var(--procarte-green);
    /* Biała fajka na zielonym tle */
    -webkit-appearance: none;
    appearance: none;
    background-color: white;
    border: 2px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.consent-item input[type="checkbox"]:checked {
    background-color: var(--procarte-green);
    border-color: var(--procarte-green);
}

.consent-item input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.consent-item label {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.consent-item a {
    color: var(--procarte-green);
    text-decoration: underline;
}

/* ===================== */
/* FORM BUTTONS - Wewnątrz scrollowalnego obszaru */
/* ===================== */
.form-buttons {
    display: flex;
    gap: 16px;
    width: 66%;
    max-width: 800px;
    margin-top: 72px;
    margin-bottom: 48px;
}

.btn-back {
    flex: 1;
    background-color: white;
    color: var(--procarte-blue);
    border: 2px solid var(--procarte-blue);
    border-radius: 0; /* Prostokątny! */
    padding: 0;
    height: 60px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back:hover {
    background-color: var(--procarte-blue);
    color: white;
}

.btn-next {
    flex: 1;
    background-color: var(--procarte-green);
    color: white;
    border: none;
    border-radius: 0; /* Prostokątny! */
    padding: 0;
    height: 60px;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-next:hover {
    background-color: #6f9118;
}

/* ===================== */
/* PROGRESS FOOTER - Identyczny jak FormFooter w Android */
/* ===================== */
.progress-footer {
    background-color: var(--procarte-blue);
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.spinner-container {
    position: relative;
    width: 48px;
    height: 72px; /* Wyższy żeby pomieścić trójkąt który nachodzi */
}

.progress-spinner {
    width: 48px;
    height: 48px;
    animation: spin 2s linear infinite;
}

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

.spinner-bg {
    stroke: #E6E6E6;
}

.spinner-progress {
    stroke: var(--procarte-green);
    stroke-dasharray: 132; /* 2 * PI * 21 */
    stroke-dashoffset: 99; /* 25% widoczne na start */
    transform-origin: center;
    transform: rotate(-90deg);
    transition: stroke-dashoffset 0.5s ease;
}

.spinner-triangle {
    position: absolute;
    top: 24px; /* Offset y=24dp jak w Android */
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: auto;
}

.footer-status {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
    font-style: italic;
    margin-top: 32px;
}

/* ===================== */
/* MODAL */
/* ===================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    border-radius: 0;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    background-color: var(--procarte-blue);
    color: white;
    padding: 20px;
    font-size: 20px;
    font-weight: 600;
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.btn-close {
    background-color: var(--procarte-blue);
    color: white;
    border: none;
    border-radius: 0;
    padding: 10px 25px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-close:hover {
    background-color: var(--procarte-blue-variant);
}

/* ===================== */
/* DIALOG - "Już wylosowałeś nagrodę" */
/* ===================== */
.dialog {
    background-color: transparent;
    text-align: center;
    padding: 30px;
}

.dialog h2 {
    color: white;
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 0;
}

.dialog .highlight {
    color: var(--procarte-green);
    font-size: 42px;
    font-weight: 700;
}

.btn-ok {
    display: none; /* Auto-dismiss po 5s */
}

/* ===================== */
/* RESPONSIVE */
/* ===================== */
/* ===================== */
/* RESPONSIVE - Media Queries */
/* ===================== */

/* Bardzo duże ekrany - nagłówek nad kołem */
@media (min-width: 1600px) {
    .wheel-header {
        top: 70px;
    }
    
    .form-header {
        top: 70px;
    }
    
    .form-content {
        padding-top: 250px;
    }
    
    .step-title {
        padding: 50px 0;
    }
    
    .background-text,
    .step-background {
        font-size: 80px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 50px;
    }
    
    .action-text {
        padding: 50px 0;
    }
}

@media (min-width: 1900px) {
    .wheel-header {
        top: 55px;
    }
    
    .form-header {
        top: 55px;
    }
    
    .form-content {
        padding-top: 230px;
    }
    
    .step-title {
        padding: 45px 0;
    }
    
    .background-text,
    .step-background {
        font-size: 75px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 46px;
    }
    
    .action-text {
        padding: 45px 0;
    }
}

/* Ekrany gdzie nagłówek może nachodzić na koło */
@media (max-height: 900px) {
    .wheel-header {
        top: 40px;
    }
    
    .form-header {
        top: 40px;
    }
    
    .form-content {
        padding-top: 220px;
    }
    
    .step-title {
        padding: 40px 0;
    }
    
    .background-text,
    .step-background {
        font-size: 70px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 44px;
    }
    
    .action-text {
        padding: 40px 0;
    }
}

@media (max-height: 700px) {
    .wheel-header {
        top: 20px;
    }
    
    .form-header {
        top: 20px;
    }
    
    .form-content {
        padding-top: 160px;
    }
    
    .step-title {
        padding: 30px 0;
    }
    
    .background-text,
    .step-background {
        font-size: 50px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 32px;
    }
    
    .action-text {
        padding: 30px 0;
    }
    
    .wheel-container {
        width: 400px;
        height: 400px;
    }
    
    .logo-triangle {
        width: 120px;
    }
    
    .bottom-section {
        bottom: 60px;
    }
}

@media (max-width: 1200px) {
    .background-text,
    .step-background {
        font-size: 60px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 42px;
    }
    
    .wheel-container {
        width: 600px;
        height: 600px;
    }
    
    .logo-triangle {
        width: 150px;
    }
}

@media (max-width: 900px) {
    .background-text,
    .step-background {
        font-size: 40px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 32px;
    }
    
    .wheel-container {
        width: 450px;
        height: 450px;
    }
    
    .logo-triangle {
        width: 120px;
    }
    
    .btn-primary {
        font-size: 22px;
        padding: 16px 40px;
        min-width: 280px;
        height: 60px;
    }
    
    .form-fields {
        width: 90%;
    }
    
    .buttons {
        width: 90%;
    }
    
    .language-selector {
        top: 30px;
        right: 30px;
    }
}

@media (max-width: 600px) {
    .wheel-header {
        top: 80px;
    }
    
    .background-text,
    .step-background {
        font-size: 28px;
    }
    
    .action-line1, .action-line2,
    .step-title .line1, .step-title .line2 {
        font-size: 24px;
    }
    
    .wheel-container {
        width: 320px;
        height: 320px;
    }
    
    .logo-triangle {
        width: 90px;
    }
    
    .btn-primary {
        font-size: 18px;
        padding: 14px 30px;
        min-width: 240px;
        height: 54px;
    }
    
    .bottom-section {
        bottom: 100px;
    }
    
    .language-selector {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .language-selector img {
        width: 32px;
        height: 32px;
    }
    
    .form-header {
        top: 80px;
    }
    
    .form-content {
        padding-top: 180px;
    }
    
    .step-title {
        padding: 25px 0;
    }
    
    .action-text {
        padding: 25px 0;
    }
    
    .form-fields {
        gap: 32px;
    }
    
    .btn-back, .btn-next {
        height: 50px;
        font-size: 18px;
    }
}
