/* Modern Design System */
:root {
    --primary: #2d3436;
    --primary-light: #636e72;
    --accent: #00b894;
    --accent-hover: #00a383;
    --danger: #ff7675;
    --warning: #fdcb6e;
    --bg: #f8f9fa;
    --white: #ffffff;
    --text: #2d3436;
    --text-light: #636e72;
    --border: #dfe6e9;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.manual-entry-radio {
    margin: 14px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}

.radio-option input {
    display: none;
}

/* външен кръг */
.radio-ui {
    width: 18px;
    height: 18px;
    border: 2px solid #bbb;
    border-radius: 50%;
    position: relative;
    transition: border-color 0.2s ease;
}

/* вътрешна точка */
.radio-ui::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #00b894;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s ease;
}

/* checked state */
.radio-option input:checked+.radio-ui {
    border-color: #00b894;
}

.radio-option input:checked+.radio-ui::after {
    transform: translate(-50%, -50%) scale(1);
}

.radio-text {
    font-size: 14px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.tuasolea-modern-container {
    max-width: 800px;
    margin: 60px auto;
    padding: 0 20px;
}

/* Step System */
.step-container {
    display: none;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-container.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Headers */
.step-header {
    text-align: center;
    margin-bottom: 48px;
}

.main-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 18px;
    color: var(--text-light);
    font-weight: 400;
}

.step-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.step-description {
    font-size: 16px;
    color: var(--text-light);
}

/* Back Button */
.back-button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 16px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-button:hover {
    background: var(--bg);
    color: var(--primary);
}

/* Action Cards */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.action-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.action-card:hover::before {
    transform: scaleX(1);
}

.action-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.action-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    font-weight: bold;
}

.action-card h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.action-card p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
}

.action-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Forms */
.verification-form,
#tuasolea-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-md);
}

/* Info Box */
.info-box {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: #e3f2fd;
    border: 2px solid #2196f3;
    border-radius: var(--radius-sm);
    margin-bottom: 32px;
    align-items: flex-start;
}

.info-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.info-content {
    font-size: 14px;
    color: #1565c0;
    line-height: 1.6;
}

.info-content strong {
    color: #0d47a1;
    display: block;
    margin-bottom: 4px;
}

/* Products Grid */
.order-products {
    margin-bottom: 24px;
}

.order-products>label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 16px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.product-item {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    transition: var(--transition);
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
}

.product-item .product-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 10;
    accent-color: var(--accent);
}

.product-item .product-label {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 0;
}

.product-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.product-item.selected {
    border-color: var(--accent);
    background: rgba(0, 184, 148, 0.05);
}

.product-item-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg);
}

.product-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-item-sku {
    font-size: 12px;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

.product-item-size {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.product-item-quantity {
    font-size: 12px;
    color: var(--text-light);
}

.product-item-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    pointer-events: none;
}

.product-item.selected .product-item-check {
    display: flex;
}

/* Policy Sections */
.policy-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 32px;
    max-height: 600px;
    overflow-y: auto;
}

.policy-section::-webkit-scrollbar {
    width: 8px;
}

.policy-section::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.policy-section::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

.policy-section::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.form-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-family: inherit;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1);
}

.field-hint {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    margin-top: 6px;
}

.field-hint.warning {
    color: var(--warning);
    font-weight: 500;
}

/* Order Info Badge */
.order-info-badge {
    background: var(--bg);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 14px;
    color: var(--text);
    display: inline-block;
}

/* Checkboxes */
.checkbox-group {
    margin-bottom: 32px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-bottom: 12px;
}

.checkbox-label:hover {
    background: var(--bg);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 1;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-radius: 6px;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition);
    pointer-events: none;
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:focus+.checkbox-custom {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.checkbox-label input[type="checkbox"]:checked+.checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-text {
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-loader {
    display: inline-block;
    animation: spin 1s linear infinite;
}

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

    to {
        transform: rotate(360deg);
    }
}

.btn-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* Messages */
.error-message,
.success-message {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 500;
}

.error-message {
    background: #fff5f5;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.success-message {
    background: #f0fdf4;
    color: var(--accent);
    border: 1px solid #bbf7d0;
}

/* Policy Section */
.policy-section {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 32px;
}

.policy-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.policy-content p {
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 16px;
}

.policy-content ul {
    list-style: none;
    padding-left: 0;
}

.policy-content ul li {
    font-size: 15px;
    color: var(--text);
    padding: 8px 0;
    padding-left: 28px;
    position: relative;
}

.policy-content ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Responsive */
@media (max-width: 768px) {
    .tuasolea-modern-container {
        margin: 32px auto;
        padding: 0 16px;
    }

    .main-title {
        font-size: 36px;
    }

    .verification-form,
    #tuasolea-form {
        padding: 24px;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

/* Animations for field validation */
.form-group input.error {
    border-color: var(--danger);
    animation: shake 0.3s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

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

/* Policy Links Section */
.policy-links-section {
    text-align: center;
    padding: 24px;
    background: rgba(33, 150, 243, 0.05);
    border-radius: var(--radius);
    margin-top: 32px;
}

.policy-links-intro {
    font-size: 15px;
    color: var(--text);
    margin-bottom: 16px;
    font-weight: 500;
}

.policy-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.policy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    border: 2px solid var(--accent);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.policy-link-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.policy-link-icon {
    font-size: 18px;
}

.policy-link-text {
    white-space: nowrap;
}

/* Policy Modal */
.policy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.policy-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.policy-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.policy-modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

.policy-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--text);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.policy-modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.policy-modal-title {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--accent);
}

.policy-modal-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
}

.policy-modal-body h3 {
    color: var(--primary);
    font-size: 20px;
    margin-top: 24px;
    margin-bottom: 12px;
}

.policy-modal-body p {
    margin-bottom: 16px;
}

.policy-modal-body ul {
    margin: 16px 0;
    padding-left: 24px;
}

.policy-modal-body li {
    margin-bottom: 8px;
}

.policy-modal-body strong {
    color: var(--primary);
    font-weight: 600;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile responsiveness for modals */
@media (max-width: 768px) {
    .policy-modal-content {
        width: 95%;
        padding: 24px;
        max-height: 90vh;
    }

    .policy-modal-title {
        font-size: 22px;
    }

    .policy-links {
        flex-direction: column;
    }

    .policy-link-btn {
        width: 100%;
        justify-content: center;
    }
}