/**
 * Style formularza APK3
 */

/* Reset */
#opti-apk3-root * {
    box-sizing: border-box;
}

/* Container */
.opti-apk3 {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Tytuł główny */
.opti-title {
    font-size: 28px;
    font-weight: 700;
    color: #111;
    margin-bottom: 24px;
    margin-top: 80px;
    text-align: center;
}

@media (max-width: 768px) {
    .opti-title {
        margin-top: 100px;
        font-size: 24px;
    }
}

/* Karty */
.opti-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.opti-step-title {
    font-size: 20px;
    font-weight: 600;
    color: #111;
    margin-bottom: 16px;
}

/* Progress bar */
.opti-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.opti-progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s;
}

.opti-progress-step.active {
    background: #111;
    color: white;
    transform: scale(1.1);
}

.opti-progress-step.completed {
    background: #00A3AD;
    color: white;
}

.opti-progress-line {
    width: 60px;
    height: 2px;
    background: #e5e7eb;
}

.opti-progress-line.completed {
    background: #00A3AD;
}

/* Formularze */
.opti-form-group {
    margin-bottom: 20px;
}

.opti-label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #374151;
}

.opti-required {
    color: #ef4444;
}

.opti-input,
.opti-select,
.opti-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
    min-height: 48px;
}

.opti-select {
    height: 48px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.opti-textarea {
    min-height: 100px;
    resize: vertical;
}

.opti-input:focus,
.opti-select:focus,
.opti-textarea:focus {
    outline: none;
    border-color: #00A3AD;
    box-shadow: 0 0 0 3px rgba(0, 163, 173, 0.1);
}

.opti-input.error,
.opti-select.error,
.opti-textarea.error {
    border-color: #ef4444;
    background: #fef2f2;
}

.opti-error-text {
    color: #ef4444;
    font-size: 13px;
    margin-top: 4px;
}

/* Grid */
.opti-grid {
    display: grid;
    gap: 16px;
}

.opti-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.opti-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 768px) {
    .opti-grid-2,
    .opti-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Checkboxy */
.opti-checkbox-group {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.opti-checkbox-group:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.opti-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.opti-checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00A3AD;
}

/* Przyciski */
.opti-btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    min-height: 48px;
}

.opti-btn-primary {
    background: #00A3AD;
    color: white;
}

.opti-btn-primary:hover:not(:disabled) {
    background: #008a93;
}

.opti-btn-secondary {
    background: white;
    color: #111;
    border: 1px solid #d1d5db;
}

.opti-btn-secondary:hover:not(:disabled) {
    background: #f9fafb;
}

.opti-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.opti-btn-group {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

@media (max-width: 768px) {
    .opti-btn-group {
        flex-direction: column;
    }
}

/* Modal */
.opti-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.opti-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.opti-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.opti-modal-close:hover {
    background: #e5e7eb;
}

/* Wiadomości */
.opti-success {
    color: #00A3AD;
    font-weight: 600;
    text-align: center;
    margin: 12px 0;
}

.opti-error {
    color: #ef4444;
    font-weight: 500;
    text-align: center;
    margin: 12px 0;
}

.opti-info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    font-size: 14px;
    color: #0c4a6e;
}

/* Sekcje potrzeb */
.opti-need-section {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    background: #f9fafb;
}

.opti-need-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 12px;
    color: #111;
}

/* Podsumowanie */
.opti-summary {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
}

.opti-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.opti-summary-row:last-child {
    border-bottom: none;
}

.opti-summary-label {
    font-weight: 600;
    color: #6b7280;
}

.opti-summary-value {
    color: #111;
    text-align: right;
}

/* Spinner */
.opti-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #00A3AD;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* OTP Box */
.opti-otp-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
}

/* Link */
.opti-link {
    color: #00A3AD;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

.opti-link:hover {
    color: #008a93;
}