/* Onboarding-specific styles - minimal overrides to main styles.css */

/* Remove any decorative top elements */
body::before,
.onboarding-container::before {
    display: none !important;
}

/* Hide any potential decorative curves or overlays at the top */
.onboarding-container > *:first-child::before,
.onboarding-container > *:first-child::after {
    display: none !important;
}

/* Ensure form elements in active step are properly clickable */
.step.active .onboarding-form,
.step.active .form-group,
.step.active .input-wrapper,
.step.active .radio-group,
.step.active .radio-option {
    pointer-events: auto;
    position: relative;
}

/* Base container layout */
.onboarding-container {
    min-height: 100vh;
    background: var(--color-white);
    display: flex;
    flex-direction: column;
}

/* Progress bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-gray-100);
    z-index: 1001;
}

.progress-fill {
    height: 100%;
    background: var(--color-blue);
    transition: width 0.3s ease;
    width: 100%;
}

/* Navigation header */
.onboarding-nav {
    padding: 20px 0;
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-100);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.onboarding-nav .nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.onboarding-nav .logo-img {
    height: 40px;
    width: auto;
}

.step-indicator {
    color: var(--color-gray-600);
    font-weight: 500;
    font-size: 14px;
}

/* Steps container */
.steps-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.4s ease;
    padding: 60px 0 20px;
    pointer-events: none;
    z-index: 1;
}

.step.active {
    opacity: 1;
    transform: translateX(0);
    position: relative;
    pointer-events: auto;
    z-index: 10;
}

.step.prev {
    transform: translateX(-100px);
    pointer-events: none;
}

/* Step content */
.step-content {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.tutorial-step .step-content {
    max-width: 600px;
}

.completion-step .step-content {
    max-width: 500px;
}

.completion-step .step-header h1 {
    font-size: 32px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.completion-step .step-header p {
    font-size: 18px;
    line-height: 1.6;
    color: var(--color-gray-600);
}

.step-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-black);
    margin-bottom: 12px;
    line-height: 1.3;
}

.step-header p {
    font-size: 16px;
    color: var(--color-gray-600);
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Form styles */
.onboarding-form {
    text-align: left;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--color-black);
    margin-bottom: 8px;
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}


.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-black);
    background: var(--color-white);
    transition: border-color 0.2s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(58, 124, 254, 0.1);
}

.input-wrapper input::placeholder {
    color: var(--color-gray-400);
}

/* Ensure input wrapper doesn't interfere */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: var(--color-gray-400);
    z-index: 11;
    font-size: 16px;
    pointer-events: none;
}

/* Radio group */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--color-gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

.radio-option:hover {
    border-color: var(--color-blue-lighter);
    background: var(--color-blue-light);
}

.radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 2;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-gray-300);
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    pointer-events: none;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    border-color: var(--color-blue);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--color-blue);
    border-radius: 50%;
}

.radio-text {
    color: var(--color-black);
    font-weight: 500;
    flex: 1;
    pointer-events: none;
}

/* Tutorial images */
.tutorial-image {
    margin-top: 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.tutorial-img {
    width: 100%;
    height: auto;
    display: block;
}

/* Completion icon and animations */
.completion-icon {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.envelope-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.animated-envelope {
    animation: floatingEnvelope 3s ease-in-out infinite;
}

@keyframes floatingEnvelope {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Completion actions */
.completion-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

/* Step-specific navigation controls */
.step-nav-controls {
    margin-top: 40px;
    width: 100%;
    text-align: center;
}

.controls-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 0;
}

/* Ensure buttons center properly */
.step-nav-controls .btn {
    display: inline-block;
    margin: 0;
}

/* Form footer */
.form-footer {
    text-align: center;
    margin-top: 32px;
}

.terms-text {
    font-size: 12px;
    color: var(--color-gray-600);
    line-height: 1.4;
}

.link {
    color: var(--color-blue);
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* Browser compatibility fixes */
.input-wrapper select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
}

/* Fix for Safari and older browsers */
.input-wrapper input,
.input-wrapper select {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* Fix for touch devices */
.radio-option {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Ensure clickable area is properly sized for mobile */
@media (max-width: 768px) {
    .radio-option {
        min-height: 48px;
    }
    
    .input-wrapper input,
    .input-wrapper select {
        min-height: 48px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step {
        padding: 40px 0 20px;
    }
    
    .step-content {
        padding: 0 20px;
    }
    
    .step-header h1 {
        font-size: 24px;
    }
    
    .completion-actions {
        gap: 12px;
    }
    
    .completion-actions .btn {
        width: 100%;
    }
    
    .completion-step .step-header h1 {
        font-size: 28px;
    }
    
    .completion-step .step-header p {
        font-size: 16px;
    }
    
    .envelope-icon {
        width: 64px;
        height: 64px;
    }
    
    .step-nav-controls {
        margin-top: 30px;
        text-align: center;
        padding: 0 20px;
    }
    
    .controls-content {
        flex-direction: column;
        gap: 12px;
    }
    
    .step-nav-controls .btn {
        display: inline-block;
        width: 100%;
        max-width: 300px;
        margin: 0;
    }
}

/* Webhook Status Styles */
.webhook-status {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;
}

.webhook-status-loading {
    background-color: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--color-blue);
}

.webhook-status-error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-red, #ef4444);
}

/* Status spinner animation */
.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Status icons and content */
.status-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.status-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-text {
    font-weight: 500;
    color: inherit;
}

.status-subtext {
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.3;
}

/* Retry button */
.retry-btn {
    align-self: flex-start;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}

.retry-btn:hover {
    background: currentColor;
    color: var(--color-white);
}

/* Mobile adjustments for webhook status */
@media (max-width: 768px) {
    .webhook-status {
        margin-top: 20px;
        padding: 14px 16px;
        font-size: 13px;
        align-items: flex-start;
    }
    
    .status-content {
        gap: 6px;
    }
    
    .retry-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}