/**
 * Migro Setup Wizard Styles
 * Based on Stitch Mockup Designs
 */

/* ========================================================================
   FONTS & CSS VARIABLES
   ======================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');

:root {
    /* Migro Color Palette */
    --migro-primary: #FF6B6B;           /* Warm Coral */
    --migro-secondary: #1E40AF;         /* Deep Blue */
    --migro-accent: #A78BFA;            /* Soft Purple */
    --migro-charcoal: #2D3748;          /* Neutral Charcoal */
    --migro-cream: #FFF8F0;             /* Warm Cream */
    
    /* Additional Colors from Mockups */
    --migro-bg-light: #f8f6f6;
    --migro-surface-light: #FFFFFF;
    --migro-text-primary: #181211;
    --migro-text-secondary: #896861;
    --migro-border: rgba(236, 55, 19, 0.2);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================================================
   GLOBAL RESET & BASE STYLES
   ======================================================================== */

.migro-content-migrator-setup-wizard {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--migro-text-primary);
    background: var(--migro-bg-light);
    height: 100vh;
    overflow: hidden;
}

.migro-content-migrator-setup-wizard *,
.migro-content-migrator-setup-wizard *::before,
.migro-content-migrator-setup-wizard *::after {
    box-sizing: border-box;
}

/* Screen reader only */
.wpcm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================================================
   WIZARD WRAPPER & STEP VISIBILITY
   ======================================================================== */

.wpcm-wizard-wrapper {
    position: relative;
    min-height: 100vh;
}

.wpcm-wizard-step {
    display: none;
}

.wpcm-wizard-step.active {
    display: block;
}

/* ========================================================================
   STEP 1: WELCOME SCREEN
   Matches: welcome_to_migro_plugin/code.html
   ======================================================================== */

.wpcm-step-welcome.active {
    background: var(--migro-bg-light);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
}

.wpcm-welcome-container {
    width: 100%;
    max-width: 600px;
    padding: 0 24px;
}

.wpcm-welcome-content {
    text-align: center;
    background: transparent;
}

/* Logo */
.wpcm-logo-wrapper {
    margin-bottom: 24px;
}

.wpcm-logo-icon {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    display: block;
}

/* Title & Description */
.wpcm-welcome-title {
    margin: 24px 0 16px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--migro-charcoal);
    letter-spacing: -0.5px;
}

.wpcm-welcome-description {
    margin: 0 0 32px;
    font-size: 16px;
    line-height: 1.6;
    color: rgba(45, 55, 72, 0.8);
}

/* Progress (below description, above button) */
.wpcm-step-progress {
    margin-bottom: 24px;
}

.wpcm-progress-label {
    font-size: 14px;
    font-weight: 500;
    color: rgba(45, 55, 72, 0.9);
    margin-bottom: 8px;
}

.wpcm-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: rgba(45, 55, 72, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.wpcm-progress-bar {
    height: 100%;
    background: var(--migro-secondary);
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* ========================================================================
   STEP 2: LICENSE SCREEN
   Matches: enter_license_key_1/code.html
   ======================================================================== */

.wpcm-step-license.active,
.wpcm-step-environment.active,
.wpcm-step-connection.active {
    background: var(--migro-bg-light);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.wpcm-card-container {
    width: 100%;
    max-width: 512px;
    margin: 0 auto;
}

.wpcm-card-container-wide {
    max-width: 720px;
}

/* Header */
.wpcm-card-header {
    margin-bottom: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.wpcm-header-icon {
    width: 70px;
    height: 70px;
}

.wpcm-card-title {
    font-size: 30px;
    font-weight: 700;
    color: var(--migro-text-primary);
    margin: 0;
}

/* Card */
.wpcm-card {
    background: var(--migro-surface-light);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* Progress inside card */
.wpcm-card-progress {
    padding: 24px 24px 0;
    border-bottom: 1px solid var(--migro-bg-light);
    padding-bottom: 24px;
}

.wpcm-card-progress .wpcm-progress-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--migro-text-secondary);
    margin-bottom: 8px;
}

.wpcm-card-progress .wpcm-progress-bar-wrap {
    height: 8px;
    background: var(--migro-bg-light);
}

.wpcm-card-progress .wpcm-progress-bar {
    background: var(--migro-primary);
}

/* Card Body */
.wpcm-card-body {
    padding: 32px;
    text-align: center;
}

.wpcm-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--migro-text-primary);
    margin: 0 0 8px;
}

.wpcm-section-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--migro-text-secondary);
    margin: 0 0 24px;
}

/* License Result */
#wpcm-license-result {
    margin: 16px 0;
}

#wpcm-license-result:empty {
    margin: 0;
}

/* Step Footer (for license step) */
.wpcm-step-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    padding: 0 16px 32px;
    max-width: 512px;
    margin-left: auto;
    margin-right: auto;
}

.wpcm-footer-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (max-width: 640px) {
    .wpcm-step-footer {
        flex-direction: column;
    }

    .wpcm-footer-right {
        width: 100%;
        flex-direction: column;
    }

    .wpcm-step-footer .wpcm-btn {
        width: 100%;
    }
}

/* Compact buttons for step footer to fit in single line */
.wpcm-step-footer .wpcm-btn {
    padding: 10px 16px;
    font-size: 13px;
    white-space: nowrap;
}

/* ========================================================================
   STEP 3 & 4: ENVIRONMENT & CONNECTION SCREENS
   Matches: select_environment/code.html
   ======================================================================== */

/* Removed duplicate - styles defined above at line 171 */

/* Header with Logo */
.wpcm-env-header {
    border-bottom: 1px solid var(--migro-border);
}

.wpcm-env-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

.wpcm-env-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 64px;
}

.wpcm-env-logo .wpcm-logo-icon {
    width: 28px;
    height: 28px;
    color: var(--migro-primary);
}

.wpcm-env-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--migro-charcoal);
    margin: 0;
}

/* Main Content Area */
.wpcm-env-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.wpcm-env-container {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
}

.wpcm-env-container-wide {
    max-width: 896px;
}

/* Progress above content */
.wpcm-env-progress {
    text-align: center;
    margin-bottom: 32px;
}

.wpcm-progress-label-primary {
    font-size: 14px;
    font-weight: 500;
    color: var(--migro-primary);
    margin-bottom: 8px;
}

.wpcm-progress-bar-wrap-coral {
    background: rgba(236, 55, 19, 0.2);
}

.wpcm-progress-bar-coral {
    background: var(--migro-primary);
    height: 6px;
}

/* Content Card */
.wpcm-env-card {
    background: var(--migro-bg-light);
    border-radius: 12px;
    border: 1px solid var(--migro-border);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wpcm-env-card-body {
    padding: 32px;
}

.wpcm-env-card-body .wpcm-section-title {
    font-size: 30px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.wpcm-env-card-body .wpcm-section-description {
    text-align: center;
    font-size: 16px;
    margin-bottom: 32px;
    color: rgba(45, 55, 72, 0.7);
}

/* ========================================================================
   STEP 5: COMPLETION SCREEN
   Matches: installation_complete!/code.html
   ======================================================================== */

.wpcm-step-complete.active {
    background: var(--migro-bg-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

/* Confetti Animation */
.wpcm-confetti-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.wpcm-confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 5s linear infinite;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Main Content */
.wpcm-complete-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    text-align: center;
}

/* Header with Logo */
.wpcm-complete-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.wpcm-complete-logo-icon {
    width: 100px !important;
    height: 100px;
}

.wpcm-complete-header-text {
    font-size: 45px;
    font-weight: 700;
    color: var(--migro-charcoal);
    margin: 0;
}

/* Success Card */
.wpcm-complete-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 64px 48px;
    border-radius: 16px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    max-width: 800px;
    margin: 0 auto;
}

.wpcm-complete-title {
    font-size: 56px;
    font-weight: 800;
    color: var(--migro-charcoal);
    margin: 0 0 24px;
    letter-spacing: -1.5px;
    line-height: 1.1;
}

.wpcm-complete-description {
    font-size: 18px;
    line-height: 1.6;
    color: rgba(45, 55, 72, 0.7);
    margin: 0 0 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.wpcm-complete-help {
    margin-top: 32px;
    font-size: 14px;
    color: rgba(45, 55, 72, 0.6);
}

/* ========================================================================
   FORMS & INPUTS
   ======================================================================== */

.wpcm-form {
    margin: 0;
}

.wpcm-form-group {
    margin-bottom: 16px;
}

.wpcm-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--migro-charcoal);
    margin-bottom: 6px;
    text-align: left;
}

.wpcm-required {
    color: var(--migro-primary);
}

.wpcm-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--migro-text-primary);
    background: var(--migro-bg-light);
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.wpcm-input:focus {
    outline: none;
    border-color: var(--migro-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.1);
}

.wpcm-input-license {
    text-align: center;
    font-size: 18px;
    letter-spacing: 2px;
    font-weight: 500;
}

.wpcm-field-description {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--migro-text-secondary);
    text-align: left;
}

/* Form Rows */
.wpcm-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .wpcm-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Compact form spacing (for connection form in wizard) */
.wpcm-form-compact .wpcm-form-group {
    margin-bottom: 12px;
}

.wpcm-form-compact .wpcm-form-row {
    gap: 12px;
    margin-bottom: 12px;
}

.wpcm-form-compact .wpcm-field-description {
    margin-top: 4px;
    font-size: 12px;
}

/* ========================================================================
   RADIO CARDS
   ======================================================================== */

.wpcm-radio-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.wpcm-radio-card {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--migro-border);
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.wpcm-radio-card:hover {
    background: rgba(255, 107, 107, 0.05);
}

.wpcm-radio-card.wpcm-radio-card-selected,
.wpcm-radio-card:has(input:checked) {
    background: rgba(255, 107, 107, 0.1);
    border-color: var(--migro-primary);
}

.wpcm-radio-card input[type="radio"] {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 107, 107, 0.4);
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    margin-top: 2px;
}

.wpcm-radio-card input[type="radio"]:checked {
    background: var(--migro-primary);
    border-color: var(--migro-primary);
}

.wpcm-radio-card input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.wpcm-radio-card input[type="radio"]:focus {
    outline: 2px solid rgba(255, 107, 107, 0.5);
    outline-offset: 2px;
}

.wpcm-radio-content {
    flex: 1;
}

.wpcm-radio-label {
    font-size: 16px;
    font-weight: 500;
    color: var(--migro-charcoal);
    margin: 0 0 4px;
}

.wpcm-radio-description {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(45, 55, 72, 0.7);
    margin: 0;
}

/* ========================================================================
   BUTTONS
   ======================================================================== */

.wpcm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.wpcm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Primary Button */
.wpcm-btn-primary {
    background: var(--migro-primary);
    color: white;
}

.wpcm-btn-primary:hover:not(:disabled) {
    background: #ff5252;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

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

/* Secondary Button (text-only coral) */
.wpcm-btn-secondary {
    background: rgba(255, 107, 107, 0.1);
    color: var(--migro-primary);
}

.wpcm-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 107, 107, 0.2);
}

/* Outline Button */
.wpcm-btn-outline {
    background: white;
    color: var(--migro-charcoal);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.wpcm-btn-outline:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

/* Block Button */
.wpcm-btn-block {
    width: 100%;
    max-width: 384px;
    margin: 0 auto;
    display: flex;
}

/* Button Group */
.wpcm-button-group {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

@media (max-width: 639px) {
    .wpcm-button-group {
        flex-direction: column;
    }
    
    .wpcm-btn {
        width: 100%;
    }
}

/* Complete Screen Buttons */
.wpcm-complete-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

@media (min-width: 640px) {
    .wpcm-complete-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

.wpcm-complete-buttons .wpcm-btn {
    min-width: 200px;
}

/* ========================================================================
   NOTICES
   ======================================================================== */

.wpcm-notice {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: left;
}

.wpcm-notice p {
    margin: 0;
    font-size: 14px;
}

.wpcm-notice p + p {
    margin-top: 4px;
}

.wpcm-notice-success {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    color: #0f766e;
}

.wpcm-notice-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #991b1b;
}

/* ========================================================================
   HELP TEXT & LINKS
   ======================================================================== */

.wpcm-help-text {
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

.wpcm-help-link {
    color: var(--migro-primary);
    text-decoration: underline;
    font-weight: 500;
    cursor: pointer;
}

.wpcm-help-link:hover {
    color: #ff5252;
}

.wpcm-help-box {
    margin-top: 24px;
    padding: 16px;
    background: rgba(78, 205, 196, 0.05);
    border: 1px solid rgba(78, 205, 196, 0.2);
    border-radius: 8px;
    text-align: left;
}

.wpcm-help-box h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--migro-charcoal);
}

.wpcm-help-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--migro-text-secondary);
}

.wpcm-help-box p + p {
    margin-top: 8px;
}

/* ========================================================================
   RESPONSIVE ADJUSTMENTS
   ======================================================================== */

@media (max-width: 640px) {
    .wpcm-welcome-title,
    .wpcm-complete-title {
        font-size: 24px;
    }
    
    .wpcm-section-title {
        font-size: 20px;
    }
    
    .wpcm-env-card-body .wpcm-section-title {
        font-size: 24px;
    }
    
    .wpcm-card-body,
    .wpcm-env-card-body {
        padding: 24px;
    }
    
    .wpcm-complete-card {
        padding: 32px 24px;
    }
}

/* ========================================================================
   LOADING & TRANSITION STATES
   ======================================================================== */

.wpcm-wizard-step {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Override WordPress admin styles */
html {
    margin: 0 !important;
    padding: 0 !important;
}

html.wp-toolbar {
    padding-top: 0 !important;
}

body.migro-content-migrator-setup-wizard {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove WordPress admin elements and their padding */
#wpadminbar {
    display: none !important;
}

#wpbody-content {
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
}

#wpcontent {
    padding: 0 !important;
}
