/* styles.css */

:root {
    --primary-color: #0083ca;
    --primary-dark: #006ba6;
    --accent-color: #ff3500;
    --secondary-color: #333333;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f8f8f8;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    background: var(--white);
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-logo {
    margin-bottom: 20px;
}

.header-logo img {
    max-width: 211px;
    height: auto;
}

.header h1 {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.header p {
    color: var(--text-light);
    font-size: 16px;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step.active:not(:last-child)::after {
    background: var(--primary-color);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    border: 2px solid var(--border-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--white);
}

.step-label {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

/* Form Card */
.form-card {
    background: var(--white);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 30px;
}

/* Form Elements */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 14px;
}

label .required {
    color: var(--error-color);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    transition: border-color 0.3s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-option {
    position: relative;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: #e6f4fb;
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.radio-option input[type="radio"]:checked ~ .radio-content {
    color: var(--primary-color);
}

.radio-option.selected {
    border-color: var(--primary-color);
    background: #e6f4fb;
}

.radio-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.radio-icon {
    font-size: 32px;
}

.radio-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.radio-text p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

/* Product Cards */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 131, 202, 0.15);
}

.product-card.selected {
    border-color: var(--primary-color);
    background: #e6f4fb;
}

.product-card input[type="checkbox"] {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.product-image-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-label {
    display: block;
    cursor: pointer;
    width: 100%;
}

.product-checkbox {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.product-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    line-height: 1.4;
}

.product-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Per-Product Details */
.products-details-section {
    margin-bottom: 30px;
}

.product-detail-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.product-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.reason-details-container {
    margin: 15px 0;
}

.reason-details-container .form-group {
    background: var(--white);
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
}

/* Photo Upload Section */
.photo-upload-section {
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.photo-upload-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.file-upload-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--white);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload-label:hover {
    background: #e6f4fb;
}

.file-upload-button {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.file-upload-text {
    flex: 1;
    font-size: 14px;
    color: var(--text-light);
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.photo-preview-item {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
}

.photo-preview-item img,
.photo-preview-item video {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-preview-item .remove-photo {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: var(--error-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.photo-preview-item .remove-photo:hover {
    background: #d32f2f;
    transform: scale(1.1);
}

.photo-preview-item .file-name {
    display: block;
    padding: 8px;
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    background: var(--bg-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Roboto', sans-serif;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--secondary-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--secondary-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.alert.show {
    display: block;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid var(--success-color);
}

.alert-warning {
    background: #fff3e0;
    color: #ef6c00;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border-left: 4px solid #2196f3;
}

/* Loading */
.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading.show {
    display: block;
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Info Box */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box h4 {
    color: #1565c0;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.info-box p {
    color: #1565c0;
    font-size: 13px;
    margin: 0;
}

/* Customer Info Display */
.customer-info {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.customer-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--secondary-color);
}

.customer-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .form-card {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .progress-steps {
        padding: 0;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
    }
    
    .photo-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Success Page Styles */
.logo-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-header img {
    max-width: 211px;
    height: auto;
}

.success-card {
    background: var(--white);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-icon svg {
    width: 50px;
    height: 50px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.checkmark {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.5s 0.3s ease-out forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.request-code {
    display: inline-block;
    background: var(--bg-light);
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 20px 0;
    letter-spacing: 2px;
}

.info-section {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
}

.info-section h2 {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.next-steps {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 20px;
    border-radius: 4px;
    text-align: left;
}

.next-steps h3 {
    color: #1565c0;
    font-size: 18px;
    margin-bottom: 15px;
}

.next-steps ol {
    margin-left: 20px;
    color: #1565c0;
}

.next-steps li {
    margin-bottom: 10px;
    line-height: 1.6;
}

.products-list {
    margin-top: 20px;
}

.product-item-success {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 10px;
}

.product-item-success .product-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    background: var(--bg-light);
    border-radius: 4px;
}

.product-item-success .product-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    justify-content: center;
}

.contact-info {
    margin-top: 30px;
    padding: 20px;
    background: #fff3e0;
    border-left: 4px solid #ff9800;
    border-radius: 4px;
    text-align: left;
}

.contact-info h3 {
    color: #ef6c00;
    font-size: 16px;
    margin-bottom: 10px;
}

.contact-info p {
    color: #ef6c00;
    font-size: 14px;
    margin: 5px 0;
}

.contact-info a {
    color: #ef6c00;
    font-weight: 600;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .form-card {
        padding: 25px 20px;
    }
    
    .success-card {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .progress-steps {
        padding: 0;
    }
    
    .step-label {
        font-size: 11px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
    }
    
    .photo-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .request-code {
        font-size: 20px;
        padding: 12px 20px;
    }
    
    .info-section {
        padding: 20px;
    }
    
    .actions {
        flex-direction: column;
    }
}

/* Hide by default */
.hidden {
    display: none !important;
}

/* Error highlighting for form fields */
.input-error {
    border-color: var(--error-color) !important;
    background-color: #ffebee !important;
    animation: shake 0.5s ease-in-out;
}

.input-error:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* Error state for product cards */
.product-card.input-error {
    border-color: var(--error-color) !important;
    background-color: #ffebee !important;
}

/* Product quantity display */
.product-qty {
    font-size: 12px;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 500;
}

/* Quantity selector in product card */
.qty-selector {
    background: var(--bg-light);
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
}

.qty-selector label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.qty-selector select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--white);
    cursor: pointer;
}

.qty-selector select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 131, 202, 0.2);
}

/* Return quantity badge in details view */
.return-qty-badge {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 10px;
    vertical-align: middle;
}

/* Footer */
.rgs-footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 30px;
    color: var(--text-light);
    font-size: 14px;
}

.rgs-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

.rgs-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.rgs-footer .copyright {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
}

/* IBAN Validation Styles */
#iban {
    font-family: 'Roboto Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 15px;
}

#iban::placeholder {
    text-transform: none;
    letter-spacing: normal;
}

.iban-feedback {
    margin-top: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 20px;
    transition: all 0.2s ease;
}

.iban-icon {
    font-weight: bold;
    font-size: 14px;
}

.iban-valid {
    color: var(--success-color);
}

.iban-valid .iban-icon {
    color: var(--success-color);
}

.iban-invalid {
    color: var(--error-color);
}

.iban-invalid .iban-icon {
    color: var(--error-color);
}

.iban-typing {
    color: var(--text-light);
}

.iban-typing .iban-icon {
    color: var(--primary-color);
}

/* Input validation states */
#iban.input-valid {
    border-color: var(--success-color);
    background-color: #f1f8e9;
}

#iban.input-valid:focus {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

#iban.input-invalid {
    border-color: var(--error-color);
    background-color: #ffebee;
}

#iban.input-invalid:focus {
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.2);
}