*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg-start: #f5f7fa;
    --bg-end: #e4edf5;
    --card-bg: #ffffff;
    --text-main: #1a202c;
    --text-muted: #4a5568;
    --text-soft: #718096;
    --text-footer: #a0aec0;
    

    --ring-idle: rgba(43,108,176,0.15);
    --ring-active: #2b6cb0;
    --success: #2f855a;
    
    --btn-bg: #E69324;
    --btn-bg-hover: #C97812;
    --btn-text: #0B0C10;
    --btn-shadow: rgba(230,147,36,0.35);
}

body {
    margin:0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

.page {
    min-height:100vh;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    margin-top:20px;
    margin-bottom:20px;
}

.card {
    background: var(--card-bg);
    padding:30px 30px;
    border-radius:22px;
    text-align:center;
    width:100%;
    max-width:550px;
    box-shadow:0 30px 60px rgba(0,0,0,0.08);
}

.logo-main {
    width:380px;
    margin-bottom:40px;
    transform:translateX(5px);
}

h2 {
    margin:0 0 10px 0;
    font-weight:600;
    letter-spacing:-0.3px;
    color: var(--text-main);
}

p {
    color: var(--text-muted);
    font-size:14px;
    font-weight:400;
    opacity:0.85; 
}

#subtitle {
    margin-bottom:40px;
}

#statusLabel{
	line-height:1.8;
}

/* Loader */
.loader-container {
    position:relative;
    width:95px;
    height:95px;
    margin:0 auto 15px auto;
}

/* Spinner ring */
.spinner {
    position:absolute;
    inset:0;
    border-radius:50%;
    border:4px solid var(--ring-idle);
    border-top-color: var(--ring-active);
    animation:spin 0.9s linear infinite;
    transition:all 0.4s ease;
    z-index:1;
}

/* Check SVG – wyżej niż spinner */
.checkmark {
    position:absolute;
    inset:0;
    width:95px;
    height:95px;
    opacity:0;
    z-index:2;
}

.checkmark path {
    fill:none;
    stroke: var(--success);
    stroke-width:6;
    stroke-linecap:round;
    stroke-linejoin:round;
    stroke-dasharray:140;
    stroke-dashoffset:140;
}

.crossmark {
    position:absolute;
    inset:0;
    width:95px;
    height:95px;
    opacity:0;
    z-index:2;
}

.crossmark path {
    fill:none;
    stroke:#dc2626;
    stroke-width:6;
    stroke-linecap:round;
    stroke-dasharray:200;
    stroke-dashoffset:200;
}

/* SUCCESS */
.spinner.success {
    animation: none;
    border: 4px solid var(--success);
}

.success + .checkmark {
    opacity:1;
}

.success + .checkmark path {
    animation:drawCheck 0.4s ease forwards;
}

/* FAILURE */
.spinner.failure {
    animation: none;
    border: 4px solid #dc2626;
}

.failure ~ .crossmark {
    opacity:1;
}

.failure ~ .crossmark path {
    animation:drawCheck 0.4s ease forwards;
}

.failure + .checkmark path {
    stroke:#dc2626;
}

@keyframes drawCheck {
    to { stroke-dashoffset:0; }
}

@keyframes spin {
    to { transform:rotate(360deg); }
}

.ap-logo {
    width:90px;
    margin-top:15px;
    opacity:0.85;
    display: inline-block;
}

.ap-logo img {
    width: 100%;
    height: auto;
    display: block;
}

.order-info {
    font-size:13px;
    color: var(--text-soft);
    margin-top:30px;
    font-weight:500;
}

.footer {
    font-size:12px;
    color: var(--text-footer);
    margin-top:30px;
    padding-top:18px;
    border-top:1px solid rgba(0,0,0,0.06);
}

.footer div {
    margin-bottom:4px;
}

.footer-links {
    margin-top:4px;
}

.footer a {
    color: var(--text-soft);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--text-main);
    text-decoration: underline;
}


.primary-btn {
    margin-top: 25px;
    padding: 14px 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;

    background: var(--btn-bg);
    color: var(--btn-text);

    border: none;
    border-radius: 14px;
    cursor: pointer;

    transition: all 0.25s ease;
    box-shadow: 0 6px 12px var(--btn-shadow);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.primary-btn:hover {
    background: var(--btn-bg-hover);
    box-shadow: 0 6px 14px var(--btn-shadow);
}

.primary-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px var(--btn-shadow);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}


.summary-stripe {
    margin-top: 36px;
    padding: 18px 32px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid rgba(0,0,0,0.06);
}

/* Większy rytm pionowy */
.summary-stripe .item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 14px 0;
}

.summary-stripe .item:first-child {
    padding-bottom: 30px; /* było 14px */
    text-transform: uppercase;
}

/* Delikatne separatory */
.summary-stripe .item:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.summary-stripe .label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--text-soft);
    padding-right: 20px;
}

.summary-stripe .value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

/* ===== TOTAL SECTION ===== */
.summary-stripe .total {
    margin: 5px 0 0px;
    padding-top: 30px;
    border-bottom: none;
}

.summary-stripe .amount {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.4px;
}

.summary-stripe .amount small {
    font-size: 14px;
    font-weight: 400;
    opacity: .6;
}

/* ===== LISTA METOD ===== */

/* ===== METODY PŁATNOŚCI ===== */

.methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.method-option {
    cursor: pointer;
}

.method-option input {
    display: none;
}

.method-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    transition: all 0.15s ease;
    background: transparent;
}

/* Dark mode border fix */
@media (prefers-color-scheme: dark) {
    .method-content {
        border: 1px solid rgba(255,255,255,0.15);
    }
}

.method-option:hover .method-content {
    border-color: #2563eb;
}

.method-option input:checked + .method-content {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.method-logo {
    width: 52px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 4px;
}
.method-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.method-name {
    font-weight: 600;
    font-size: 14px;
	color: var(--text-soft)
}

.method-desc {
    font-size: 12px;
    opacity: 0.7;
}

/* ===== CHECKBOX ===== */

.terms {
    margin-top: 16px;
    text-align: left;
}

.terms a {
    color: var(--text-soft);
    text-decoration: underline;
}

.terms a:hover {
    opacity: 0.85;
}

.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.4;
}

/* Ukrywamy natywny checkbox */
.terms-row input {
    display: none;
}

/* Własny checkbox */
.custom-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(0,0,0,0.3);
    border-radius: 4px;
    margin-top: 2px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

/* Checked state */
.terms-row input:checked + .custom-checkbox {
    background: #2563eb;
    border-color: #2563eb;
}

/* Checkmark */
.terms-row input:checked + .custom-checkbox::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Tekst */
.terms-text {
    flex: 1;
}

.terms-text strong {
    display: block;
    margin-bottom: 4px;
}

/* RESPONSYWNOŚĆ */

@media (max-width: 480px) {

    .logo-main {
        width: min(300px, 80vw);
        margin-bottom: 25px;
    }

    .card {
        width: 92%;
        max-width: 420px;
        padding: 35px 22px;
        border-radius: 18px;
    }

    h2 {
        font-size: 20px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }

    .loader-container {
        width: 95px;
        height: 95px;
        margin-bottom: 18px;
    }

    .spinner,
    .checkmark {
        width: 95px;
        height: 95px;
    }

    .ap-logo {
        width: 60px;
    }

    .order-info {
        font-size: 13px;
    }
    
    .summary-stripe {
        padding: 18px 18px; /* mniejszy padding boczny */
    }

    .summary-stripe .item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .summary-stripe .label {
        font-size: 18px;
    }

    .summary-stripe .value {
        text-align: left;
        max-width: 100%;
        font-size: 14px;
        line-height: 1.8;
        padding-left: 12px;
    }

    .summary-stripe .amount {
        font-size: 22px;
    }
}

@media (prefers-color-scheme: dark) {

    :root {
        --bg-start: #13171C;
        --bg-end: #1A1D21;

        --card-bg: #1E2329;

        --text-main: #E7EAF0;
        --text-muted: #D5DCE7;
        --text-soft: #BFC7D4;
        --text-footer: #8C97A6;

        /* Spinner */
        --ring-idle: rgba(230,147,36,0.18);
        --ring-active: #E69324;

        /* Success */
        --success: #22c55e;
        
        --btn-bg: #E69324;
        --btn-bg-hover: #FFB24A;
        --btn-text: #0B0C10;
        --btn-shadow: rgba(230,147,36,0.18);
    }

    .card {
        box-shadow: 0 20px 50px rgba(0,0,0,0.6);
        border: 1px solid rgba(255,255,255,0.05);
    }

    .spinner {
        border:4px solid var(--ring-idle);
        border-top-color: var(--ring-active);
    }

    .success {
        border-color: var(--success);
    }

    .checkmark path {
        stroke: var(--success);
    }

    .ap-logo {
        opacity:0.95;
        filter: brightness(1.05);
    }
    
    .footer {
        border-top:1px solid rgba(255,255,255,0.08);
    }
    
    .summary-stripe {
        border: 1px solid rgba(255,255,255,0.06);
    }

    .summary-stripe .item:not(:last-child) {
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }
	
    .method-content {
        border: 1px solid rgba(255,255,255,0.06);
    }
	
    .method-logo {
        background: rgba(255, 255, 255, 0.08);
    }

    .method-option input:checked + .method-content {
        border-color: #E69324;
        box-shadow: 0 0 0 2px rgba(230,147,36,0.25);
    }
	
    .custom-checkbox {
        border: 1.5px solid rgba(255,255,255,0.4);
    }
}

@media (prefers-color-scheme: light) {
    .method-logo {
        background: rgba(0, 0, 0, 0.04);
    }
}