/* =======================================
   PRETPLATA FORMA - Frontend Styles
   Primary: #0A244C | White: #ffffff
   ======================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --pret-primary: #0A244C;
    --pret-primary-light: #1a3d7a;
    --pret-primary-dark: #061730;
    --pret-accent: #1e6abf;
    --pret-white: #ffffff;
    --pret-bg: #f4f7fb;
    --pret-border: #d0dce8;
    --pret-text: #1a2a3a;
    --pret-text-muted: #607080;
    --pret-error: #0A244C;
    --pret-success: #0A244C;
    --pret-radius: 10px;
    --pret-shadow: 0 4px 24px rgba(10,36,76,0.12);
}

.pretplata-wrapper * {
    box-sizing: border-box;
}

.pretplata-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    color: var(--pret-text);
    max-width: 760px;
    margin: 40px auto;
    padding: 0 16px;
}

/* ---- Global font override for all wrapper children ---- */
.pretplata-wrapper,
.pretplata-wrapper h2,
.pretplata-wrapper h3,
.pretplata-wrapper p,
.pretplata-wrapper label,
.pretplata-wrapper input,
.pretplata-wrapper button,
.pretplata-wrapper span,
.pretplata-wrapper div {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ---- Hard reset all buttons inside wrapper ---- */
.pretplata-wrapper button,
.pretplata-wrapper input[type="submit"] {
    background-color: var(--pret-primary) !important;
    color: #ffffff !important;
    border-color: var(--pret-primary) !important;
    border-radius: 8px;
    outline: none !important;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

/* ---- Hard reset type toggle buttons ---- */
.pretplata-wrapper .type-btn {
    background: var(--pret-white) !important;
    color: var(--pret-text-muted) !important;
    border: 2px solid var(--pret-border) !important;
}

.pretplata-wrapper .type-btn:hover {
    border-color: var(--pret-accent) !important;
    color: var(--pret-accent) !important;
    background: var(--pret-white) !important;
}

.pretplata-wrapper .type-btn.active {
    background: var(--pret-primary) !important;
    border-color: var(--pret-primary) !important;
    color: var(--pret-white) !important;
}

/* ---- Hard reset qty buttons ---- */
.pretplata-wrapper .qty-btn {
    background: var(--pret-primary) !important;
    background-color: var(--pret-primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-color: transparent !important;
}

.pretplata-wrapper .qty-btn:hover {
    background: var(--pret-primary-light) !important;
    background-color: var(--pret-primary-light) !important;
}

/* ---- Container ---- */
.pretplata-form-container {
    background: var(--pret-white);
    border-radius: 16px;
    box-shadow: var(--pret-shadow);
    overflow: hidden;
    border: 1px solid var(--pret-border);
}

/* ---- Header ---- */
.pretplata-form-header {
    background: var(--pret-primary);
    padding: 36px 40px 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pretplata-form-header::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

.pretplata-form-header::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
}

.pretplata-logo-mark {
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4), rgba(255,255,255,0.9));
    margin: 0 auto 16px;
    border-radius: 2px;
}

.pretplata-form-header h2 {
    color: var(--pret-white) !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    margin: 0 0 8px !important;
    letter-spacing: -0.3px;
    position: relative;
}

.pretplata-form-header p {
    color: rgba(255,255,255,0.7) !important;
    font-size: 14px !important;
    margin: 0 !important;
    position: relative;
}

/* ---- Sections ---- */
.pretplata-section {
    padding: 28px 40px;
    border-bottom: 1px solid var(--pret-border);
}

.pretplata-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    color: var(--pret-primary) !important;
    margin: 0 0 20px !important;
    padding-bottom: 10px !important;
    border-bottom: 2px solid var(--pret-primary) !important;
    display: inline-block !important;
}

/* ---- Fields placeholder (shown before type selected) ---- */
.pret-section-placeholder {
    padding: 14px 0 4px;
    color: var(--pret-text-muted);
    font-size: 13px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pret-section-placeholder::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    min-width: 14px;
    border: 2px solid var(--pret-border);
    border-top-color: var(--pret-accent);
    border-radius: 50%;
    opacity: 0.6;
}

/* ---- Step toggle section ---- */
.pretplata-step-toggle {
    background: #f4f7fb;
    border-bottom: 1px solid var(--pret-border) !important;
}

.pret-toggle-label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--pret-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
    margin: 0 0 14px !important;
}

/* ---- Type Toggle ---- */
.pretplata-type-toggle {
    display: flex;
    gap: 12px;
}

.type-btn {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--pret-border);
    border-radius: var(--pret-radius);
    background: var(--pret-white);
    color: var(--pret-text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.type-btn:hover {
    border-color: var(--pret-accent);
    color: var(--pret-accent);
}

.type-btn.active {
    background: var(--pret-primary);
    border-color: var(--pret-primary);
    color: var(--pret-white);
    box-shadow: 0 4px 12px rgba(10,36,76,0.25);
}

.type-icon {
    font-size: 18px;
}

/* ---- Fields Grid ---- */
.pretplata-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pretplata-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pretplata-field-group.full-width {
    grid-column: 1 / -1;
}

.pretplata-field-group label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--pret-primary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.8px !important;
}

.pretplata-field-group input[type="text"],
.pretplata-field-group input[type="email"],
.pretplata-field-group input[type="tel"],
.pretplata-field-group input[type="number"] {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--pret-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    color: var(--pret-text);
    background: #fafcff;
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
}

.pretplata-field-group input:focus {
    border-color: var(--pret-accent);
    background: var(--pret-white);
    box-shadow: 0 0 0 3px rgba(30,106,191,0.12);
}

.pretplata-field-group input.error {
    border-color: var(--pret-primary);
    box-shadow: 0 0 0 3px rgba(10,36,76,0.1);
}

.pretplata-field-group input::placeholder {
    color: #bcc8d8;
}

.required {
    color: var(--pret-primary);
}

.field-error {
    font-size: 12px;
    color: var(--pret-error);
    min-height: 16px;
}

/* ---- Pravno lice section ---- */
.pretplata-pravno-section {
    background: #f0f5ff;
    border-top: 2px solid #c5d5e8;
}

/* ---- Products List ---- */
.pretplata-hint {
    font-size: 13px;
    color: var(--pret-text-muted);
    margin: 0 0 16px !important;
}

.pretplata-products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pretplata-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1.5px solid var(--pret-border);
    border-radius: var(--pret-radius);
    background: #fafcff;
    transition: all 0.2s;
    gap: 16px;
}

.pretplata-product-row:hover {
    border-color: #a0b8d4;
    background: var(--pret-white);
}

.pretplata-product-row.is-selected {
    border-color: var(--pret-primary);
    background: #f0f5ff;
    box-shadow: 0 2px 8px rgba(10,36,76,0.1);
}

.pretplata-product-checkbox {
    display: flex;
    align-items: center;
    flex: 1;
}

.pretplata-checkbox {
    display: none;
}

.pretplata-product-label {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    width: 100%;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid var(--pret-border);
    border-radius: 6px;
    background: var(--pret-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.pretplata-checkbox:checked + .pretplata-product-label .checkbox-custom {
    background: var(--pret-primary);
    border-color: var(--pret-primary);
}

.pretplata-checkbox:checked + .pretplata-product-label .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
}

.product-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--pret-text);
    line-height: 1.4;
}

.pretplata-product-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* ---- Quantity Controls ---- */
.pretplata-qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--pret-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--pret-white);
}

.qty-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: var(--pret-primary);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: inherit;
}

.qty-btn:hover {
    background: var(--pret-primary-light);
}

.qty-input {
    width: 46px !important;
    height: 34px !important;
    border: none !important;
    border-left: 1px solid var(--pret-border) !important;
    border-right: 1px solid var(--pret-border) !important;
    border-radius: 0 !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    background: white !important;
    box-shadow: none !important;
    outline: none !important;
}

.qty-input:focus {
    box-shadow: none !important;
    border-color: var(--pret-border) !important;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.product-price-display {
    font-size: 15px;
    font-weight: 700;
    color: var(--pret-primary);
    min-width: 80px;
    text-align: right;
}

.product-price-display .woocommerce-Price-amount {
    color: var(--pret-primary);
    font-weight: 700;
}

/* ---- Total ---- */
.pretplata-total-section {
    background: var(--pret-primary);
    padding: 20px 40px;
    margin: 0;
}

.pretplata-total-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.total-label {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.total-amount {
    color: var(--pret-white);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.pretplata-selected-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.summary-tag {
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

/* ---- Submit ---- */
.pretplata-submit-section {
    padding: 28px 40px;
    text-align: center;
}

.pretplata-wrapper .pretplata-btn-submit,
.pretplata-wrapper #pretplata-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 24px;
    background: var(--pret-primary) !important;
    background-color: var(--pret-primary) !important;
    color: var(--pret-white) !important;
    border: none !important;
    border-color: transparent !important;
    border-radius: var(--pret-radius);
    font-family: 'Inter', sans-serif !important;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(10,36,76,0.3);
    position: relative;
    overflow: hidden;
    -webkit-appearance: none !important;
    appearance: none !important;
    text-decoration: none !important;
    white-space: normal;
    word-break: break-word;
    line-height: 1.4;
    min-height: 54px;
}

.pretplata-wrapper .pretplata-btn-submit::before,
.pretplata-wrapper #pretplata-submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transition: left 0.5s;
}

.pretplata-wrapper .pretplata-btn-submit:hover:not(:disabled)::before,
.pretplata-wrapper #pretplata-submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.pretplata-wrapper .pretplata-btn-submit:hover:not(:disabled),
.pretplata-wrapper #pretplata-submit-btn:hover:not(:disabled) {
    background: var(--pret-primary-light) !important;
    background-color: var(--pret-primary-light) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10,36,76,0.35);
}

.pretplata-wrapper .pretplata-btn-submit:disabled,
.pretplata-wrapper #pretplata-submit-btn:disabled {
    background: #8a9ab0 !important;
    background-color: #8a9ab0 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.pretplata-wrapper .pretplata-btn-submit:disabled .btn-arrow,
.pretplata-wrapper #pretplata-submit-btn:disabled .btn-arrow {
    display: none;
}

.btn-arrow {
    font-size: 20px;
    transition: transform 0.2s;
}

.pretplata-btn-submit:hover:not(:disabled) .btn-arrow {
    transform: translateX(4px);
}

.pretplata-secure-note {
    margin: 12px 0 0 !important;
    font-size: 12px !important;
    color: var(--pret-text-muted) !important;
}

/* ---- Spinner ---- */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ---- Messages ---- */
#pretplata-form-message {
    margin: 0 40px 20px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

#pretplata-form-message.error {
    background: #eef3fa;
    border: 1px solid #a0b8d4;
    color: var(--pret-primary);
}

#pretplata-form-message.success {
    background: #eef3fa;
    border: 1px solid #a0b8d4;
    color: var(--pret-primary);
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .pretplata-section {
        padding: 20px 20px;
    }

    .pretplata-form-header {
        padding: 28px 20px 24px;
    }

    .pretplata-fields-grid {
        grid-template-columns: 1fr;
    }

    .pretplata-field-group.full-width {
        grid-column: 1;
    }

    .pretplata-type-toggle {
        flex-direction: column;
    }

    .pretplata-total-section {
        padding: 16px 20px;
    }

    .total-amount {
        font-size: 22px;
    }

    .pretplata-submit-section {
        padding: 20px 20px;
    }

    .pretplata-product-row {
        flex-wrap: wrap;
    }

    #pretplata-form-message {
        margin: 0 20px 16px;
    }
}
