/* ============================================
   BUTTON ICON & TEXT ALIGNMENT FIXES
   ============================================ */

/* Ensure all buttons use flexbox for proper alignment */
button,
.btn,
[class*="btn-"],
[class*="-btn"],
a.button,
input[type="button"],
input[type="submit"] {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    white-space: nowrap;
}

/* Icon alignment within buttons */
button .iconify,
.btn .iconify,
[class*="btn-"] .iconify,
[class*="-btn"] .iconify,
a.button .iconify {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
}

/* Specific button variations */
.form-submit-btn,
.form-secondary-btn {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

/* Ensure spans inside buttons are inline */
button span,
.btn span,
[class*="btn-"] span,
[class*="-btn"] span {
    display: inline-flex;
    align-items: center;
    line-height: inherit;
}

/* CTA Buttons (Hero section, etc.) */
.cta-button,
[class*="cta-"] {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
    padding: 1rem 2rem !important;
}

.cta-button .iconify,
[class*="cta-"] .iconify {
    font-size: 1.25rem;
}

/* Social login buttons */
.social-login-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.75rem !important;
}

/* Link-style buttons */
a[class*="btn"],
a[class*="button"] {
    text-decoration: none;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
}

/* Password toggle buttons */
.password-toggle {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem !important;
}

/* Loading state buttons */
button:has(.iconify.animate-spin),
.btn:has(.iconify.animate-spin) {
    gap: 0.75rem !important;
}

/* Icon-only buttons */
button:not(:has(span:not(.iconify))),
.btn:not(:has(span:not(.iconify))) {
    padding: 0.75rem !important;
    aspect-ratio: 1;
}

/* Responsive button adjustments */
@media (max-width: 640px) {
    .cta-button,
    [class*="cta-"] {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.9375rem;
    }
    
    .cta-button .iconify,
    [class*="cta-"] .iconify {
        font-size: 1.125rem;
    }
}

/* Fix for Tailwind utility classes */
.flex-row {
    flex-direction: row !important;
}

.inline-flex {
    display: inline-flex !important;
}

.items-center {
    align-items: center !important;
}

.justify-center {
    justify-content: center !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

.gap-3 {
    gap: 0.75rem !important;
}

/* Ensure icons don't wrap */
button > *,
.btn > *,
[class*="btn-"] > * {
    flex-shrink: 0;
}

/* Fix button text alignment */
button span:not(.iconify),
.btn span:not(.iconify) {
    line-height: 1.5;
    display: inline;
}

/* Prevent any flex-column from buttons */
button[class*="flex-col"],
.btn[class*="flex-col"] {
    flex-direction: row !important;
}

/* Override any space-y classes on buttons */
button[class*="space-y"],
.btn[class*="space-y"] {
    gap: 0.5rem !important;
}

button[class*="space-y"] > *,
.btn[class*="space-y"] > * {
    margin: 0 !important;
}
