/**
 * Estilos públicos do formulário.
 */

/* Reset e variáveis */
.ac-container {
    --ac-primary: #6366f1;
    --ac-primary-hover: #4f46e5;
    --ac-primary-light: #e0e7ff;
    --ac-success: #22c55e;
    --ac-success-light: #dcfce7;
    --ac-warning: #f59e0b;
    --ac-warning-light: #fef3c7;
    --ac-danger: #ef4444;
    --ac-danger-light: #fee2e2;
    --ac-bg: #0f172a;
    --ac-bg-card: #1e293b;
    --ac-bg-input: #334155;
    --ac-border: #475569;
    --ac-text: #f8fafc;
    --ac-text-muted: #94a3b8;
    --ac-radius: 12px;
    --ac-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--ac-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.ac-container * {
    box-sizing: border-box;
}

/* Container principal */
.ac-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Steps */
.ac-step {
    display: none;
    animation: acFadeIn 0.4s ease;
}

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

@keyframes acFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.ac-card {
    background: var(--ac-bg-card);
    border-radius: var(--ac-radius);
    padding: 32px;
    box-shadow: var(--ac-shadow);
    border: 1px solid var(--ac-border);
}

.ac-card-centered {
    text-align: center;
    padding: 60px 32px;
}

.ac-card-header {
    text-align: center;
    margin-bottom: 32px;
}

.ac-card-header h2 {
    margin: 16px 0 8px;
    font-size: 24px;
    font-weight: 700;
    color: var(--ac-text);
}

.ac-card-header p {
    margin: 0;
    color: var(--ac-text-muted);
    font-size: 15px;
}

/* Icon */
.ac-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ac-primary-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.ac-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--ac-primary);
}

.ac-icon-success {
    background: var(--ac-success-light);
}

.ac-icon-success svg {
    stroke: var(--ac-success);
}

/* Form */
.ac-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ac-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ac-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ac-text);
}

.ac-form-group input,
.ac-form-group select {
    width: 100%;
    padding: 14px 16px;
    background: var(--ac-bg-input);
    border: 1px solid var(--ac-border);
    border-radius: 8px;
    font-size: 16px;
    color: var(--ac-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ac-form-group input::placeholder {
    color: var(--ac-text-muted);
}

.ac-form-group input:focus,
.ac-form-group select:focus {
    outline: none;
    border-color: var(--ac-primary);
    box-shadow: 0 0 0 3px var(--ac-primary-focus, rgba(99, 102, 241, 0.2));
}

.ac-form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 44px;
}

/* Buttons */
.ac-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ac-button svg {
    width: 20px;
    height: 20px;
}

.ac-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ac-button-primary {
    background: var(--ac-primary);
    color: #fff;
}

.ac-button-primary:hover:not(:disabled) {
    background: var(--ac-primary-hover);
    transform: translateY(-1px);
}

.ac-button-secondary {
    background: var(--ac-bg-input);
    color: var(--ac-text);
    border: 1px solid var(--ac-border);
}

.ac-button-secondary:hover:not(:disabled) {
    background: var(--ac-border);
}

.ac-button-cta {
    background: linear-gradient(135deg, var(--ac-success), var(--ac-success-dark, #16a34a));
    color: #fff;
    font-size: 18px;
    padding: 18px 32px;
}

.ac-button-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--ac-success-shadow, rgba(34, 197, 94, 0.3));
}

.ac-button-full {
    width: 100%;
}

.ac-button-group {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.ac-button-group-center {
    justify-content: center;
    flex-wrap: wrap;
}

/* Upload instructions */
.ac-upload-instructions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ac-instruction-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ac-bg-input);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--ac-text-muted);
}

.ac-instruction-number {
    width: 20px;
    height: 20px;
    background: var(--ac-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

/* Dropzone */
.ac-dropzone {
    border: 2px dashed var(--ac-border);
    border-radius: var(--ac-radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--ac-bg);
}

.ac-dropzone:hover,
.ac-dropzone.ac-dragover {
    border-color: var(--ac-primary);
    background: var(--ac-primary-light-bg, rgba(99, 102, 241, 0.05));
}

.ac-dropzone-content svg {
    width: 48px;
    height: 48px;
    stroke: var(--ac-text-muted);
    margin-bottom: 16px;
}

.ac-dropzone-content p {
    margin: 0 0 8px;
    color: var(--ac-text);
    font-size: 15px;
}

.ac-link {
    color: var(--ac-primary);
    text-decoration: underline;
    cursor: pointer;
}

.ac-dropzone-hint {
    font-size: 13px;
    color: var(--ac-text-muted);
}

/* Preview container */
.ac-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.ac-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.ac-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.ac-preview-remove:hover {
    background: var(--ac-danger);
}

/* Loading */
.ac-loading-animation {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.ac-loading-spinner {
    position: absolute;
    inset: 0;
    border: 3px solid var(--ac-border);
    border-top-color: var(--ac-primary);
    border-radius: 50%;
    animation: acSpin 1s linear infinite;
}

.ac-loading-pulse {
    position: absolute;
    inset: 10px;
    background: var(--ac-primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: acPulse 1.5s ease-in-out infinite;
}

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

@keyframes acPulse {
    0%, 100% { transform: scale(0.8); opacity: 0.3; }
    50% { transform: scale(1); opacity: 0.5; }
}

.ac-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.ac-loading-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--ac-text-muted);
    font-size: 14px;
}

.ac-loading-step-active {
    color: var(--ac-primary);
}

.ac-loading-dot {
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
}

.ac-loading-step-active .ac-loading-dot {
    animation: acPulse 1s ease-in-out infinite;
}

/* Results */
.ac-results-content {
    margin-bottom: 24px;
}

.ac-result-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--ac-border);
}

.ac-result-item:last-child {
    border-bottom: none;
}

.ac-result-icon {
    width: 40px;
    height: 40px;
    background: var(--ac-bg-input);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}

.ac-result-content h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ac-text);
}

.ac-result-content p {
    margin: 0;
    font-size: 15px;
    color: var(--ac-text-muted);
}

.ac-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.ac-badge-primary {
    background: var(--ac-primary-light);
    color: var(--ac-primary);
}

.ac-badge-success {
    background: var(--ac-success-light);
    color: #166534;
}

.ac-badge-warning {
    background: var(--ac-warning-light);
    color: #92400e;
}

/* Simulator options */
.ac-photo-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ac-photo-option {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.ac-photo-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-photo-option:hover {
    border-color: var(--ac-border);
}

.ac-photo-option.ac-selected {
    border-color: var(--ac-primary);
}

.ac-style-selector {
    display: flex;
    gap: 12px;
}

.ac-style-btn {
    flex: 1;
    padding: 16px 12px;
    background: var(--ac-bg-input);
    border: 2px solid var(--ac-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    color: var(--ac-text);
}

.ac-style-btn:hover {
    border-color: var(--ac-text-muted);
}

.ac-style-btn-active {
    border-color: var(--ac-primary);
    background: var(--ac-primary-light-bg, rgba(99, 102, 241, 0.1));
}

.ac-style-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 6px;
}

/* Before/After slider */
.ac-before-after {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--ac-radius);
    overflow: hidden;
    margin-bottom: 24px;
    background: var(--ac-bg);
}

.ac-ba-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-ba-before {
    clip-path: inset(0 50% 0 0);
}

.ac-ba-slider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: #fff;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
}

.ac-ba-slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ac-ba-slider::after {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: var(--ac-bg);
    font-weight: bold;
}

.ac-ba-label {
    position: absolute;
    bottom: 16px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 20px;
}

.ac-ba-label-before {
    left: 16px;
}

.ac-ba-label-after {
    right: 16px;
}

/* CTA Section */
.ac-cta-section {
    text-align: center;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--ac-border);
}

.ac-cta-section h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
}

.ac-cta-section p {
    margin: 0 0 20px;
    color: var(--ac-text-muted);
}

/* Toast */
.ac-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--ac-bg-card);
    color: var(--ac-text);
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: var(--ac-shadow);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s;
    border: 1px solid var(--ac-border);
}

.ac-toast.ac-toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.ac-toast-error {
    border-color: var(--ac-danger);
    background: var(--ac-danger-light);
    color: #991b1b;
}

.ac-toast-success {
    border-color: var(--ac-success);
    background: var(--ac-success-light);
    color: #166534;
}

/* Responsivo */
@media (max-width: 600px) {
    .ac-container {
        padding: 12px;
    }
    
    .ac-card {
        padding: 24px 20px;
    }
    
    .ac-upload-instructions {
        flex-direction: column;
    }
    
    .ac-button-group {
        flex-direction: column;
    }
    
    .ac-style-selector {
        flex-direction: column;
    }
}

/* Light theme variant */
.ac-container[data-theme="light"] {
    --ac-bg: #f8fafc;
    --ac-bg-card: #ffffff;
    --ac-bg-input: #f1f5f9;
    --ac-border: #e2e8f0;
    --ac-text: #1e293b;
    --ac-text-muted: #64748b;
}
