/* Native App Feel Enhancements */

:root {
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
    --primary-blue: #1488e5;
    --primary-blue-dark: #0e5a9c;
    /* Shadow color */
}

body {
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: none;

    /* Disable text selection for a more app-like feel */
    -webkit-user-select: none;
    user-select: none;

    /* Optimize touch interactions */
    touch-action: manipulation;

    /* Handle notch/safe areas */
    padding-top: var(--safe-area-top) !important;
    padding-bottom: var(--safe-area-bottom) !important;

    /* Improve font rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Ensure background is white/clean */
    background-color: #ffffff;
}

/* Allow text selection in inputs */
input,
textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* Remove tap highlight color */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    height: 100%;
}

/* --- 3D Button Style --- */
.btn-3d {
    background-color: var(--primary-blue) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 5px 0 var(--primary-blue-dark) !important;
    /* The 3D effect */
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700 !important;
    /* Remove any gradients */
    background-image: none !important;
}

.btn-3d:active,
.btn-3d.active {
    box-shadow: 0 0 0 var(--primary-blue-dark) !important;
    top: 5px !important;
    /* Moves down by the shadow size */
    outline: none !important;
}

/* --- Loading Spinner --- */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
    margin-left: 10px;
}

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

/* When button is loading */
.btn-loading {
    pointer-events: none;
    /* Disable clicks */
    opacity: 0.9;
}

.btn-loading .spinner {
    display: inline-block;
    /* Show spinner */
}

/* --- Improved OTP Inputs --- */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.otp-input {
    width: 50px !important;
    height: 60px !important;
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #333 !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    background-color: #f8fafc !important;
    transition: all 0.2s ease;
    padding: 0 !important;
    margin: 0 !important;
    /* Remove native appearance */
    -webkit-appearance: textfield;
    -moz-appearance: textfield;
    appearance: textfield;
}

.otp-input:focus {
    border-color: var(--primary-blue) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 4px rgba(20, 136, 229, 0.1) !important;
    outline: none !important;
    transform: translateY(-2px);
}

.otp-input::-webkit-outer-spin-button,
.otp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Fix for broken clean layout look */
.max-w-sm {
    max-width: 100% !important;
    width: 100% !important;
}

/* Hide potential gradients from Tailwind */
.bg-gradient-to-r,
.bg-gradient-to-b,
.bg-gradient-to-t {
    background-image: none !important;
}