* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #581c87 50%, #0f172a 100%);
    overflow-x: hidden;
    position: relative;
}

/* Animated Background Blobs - Optimized for Mobile */
.blob {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    filter: blur(40px);
    mix-blend-mode: multiply;
    opacity: 0.15;
    animation: blob 7s infinite;
    z-index: 0;
}

.blob-1 {
    background: #a855f7;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    background: #06b6d4;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

.blob-3 {
    background: #ec4899;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 4s;
}

@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(20px, -30px) scale(1.05);
    }
    66% {
        transform: translate(-15px, 15px) scale(0.95);
    }
}

/* Container - Mobile Optimized */
.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

/* Header - Mobile Sizes */
.header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bot-icon {
    padding: 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #a855f7 0%, #06b6d4 100%);
    box-shadow: 0 15px 20px -5px rgba(168, 85, 247, 0.4);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-icon svg {
    color: white;
    width: 24px;
    height: 24px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.logo-section h1 {
    font-size: 28px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.025em;
}

.subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
}

.subtitle .sparkle {
    color: #06b6d4;
}

.subtitle .sparkle:last-child {
    color: #a855f7;
}

.subtitle p {
    font-size: 14px;
    color: #cbd5e1;
}

/* Card - Mobile Optimized */
.card {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:active {
    transform: scale(0.98);
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.card-header p {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.5;
}

/* Form - Mobile Touch-Friendly */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px; /* Prevent zoom on iOS */
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    resize: none;
    font-family: inherit;
    -webkit-appearance: none; /* Remove iOS default styling */
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.form-group input:disabled,
.form-group textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-group textarea {
    min-height: 120px;
}

/* Submit Button - Touch Optimized */
.submit-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #a855f7 0%, #06b6d4 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 12px -3px rgba(168, 85, 247, 0.5);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight */
    touch-action: manipulation; /* Improve touch response */
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.submit-btn svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* Footer - Mobile Friendly */
.footer {
    margin-top: 24px;
    text-align: center;
    padding: 0 10px;
}

.footer p {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.4;
}

/* Toast Notifications - Mobile Positioned */
#toast-container {
    position: fixed;
    top: 16px;
    left: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 8px 12px -3px rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.toast svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* ====================================
   MOBILE BREAKPOINTS
   ==================================== */

/* Very Small Phones (iPhone SE, etc) */
@media (max-width: 374px) {
    .logo-section h1 {
        font-size: 24px;
    }
    
    .subtitle p {
        font-size: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card-header h2 {
        font-size: 18px;
    }
    
    .card-header p {
        font-size: 12px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .submit-btn {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .toast {
        font-size: 12px;
        padding: 12px 14px;
    }
}

/* Standard Phones (375px - 424px) */
@media (min-width: 375px) and (max-width: 424px) {
    .logo-section h1 {
        font-size: 26px;
    }
    
    .card {
        padding: 18px;
    }
}

/* Large Phones (425px - 640px) */
@media (min-width: 425px) and (max-width: 640px) {
    .logo-section h1 {
        font-size: 32px;
    }
    
    .subtitle p {
        font-size: 16px;
    }
    
    .card {
        padding: 24px;
        max-width: 500px;
    }
    
    .card-header h2 {
        font-size: 22px;
    }
    
    .form-group textarea {
        min-height: 140px;
    }
}

/* Landscape Mode Optimization */
@media (max-width: 640px) and (orientation: landscape) {
    .container {
        padding: 16px;
        justify-content: flex-start;
    }
    
    .header {
        margin-bottom: 16px;
    }
    
    .logo-section h1 {
        font-size: 22px;
    }
    
    .bot-icon {
        padding: 6px;
    }
    
    .bot-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .subtitle {
        display: none; /* Hide subtitle in landscape to save space */
    }
    
    .card {
        padding: 16px;
    }
    
    .form-group textarea {
        min-height: 80px;
    }
}

/* Touch Improvements for All Mobile */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
    }
    
    .submit-btn:hover:not(:disabled) {
        transform: none;
        box-shadow: 0 8px 12px -3px rgba(168, 85, 247, 0.5);
    }
}
