/* ============================================
   Intesa Sanpaolo Bank - Professional Styling
   ============================================ */

/* === CSS Variables === */
:root {
    --primary: #003b71;
    --primary-dark: #002d5a;
    --primary-light: #0056a6;
    --primary-10: rgba(0, 59, 113, 0.1);
    --primary-20: rgba(0, 59, 113, 0.2);
    --accent: #d4a843;
    --accent-light: #e8c46a;
    --accent-dark: #b8912e;
    --gold-gradient: linear-gradient(135deg, #d4a843, #e8c46a, #d4a843);
    --bg-gradient: linear-gradient(135deg, #002d5a 0%, #003b71 30%, #004d8c 60%, #001f3d 100%);
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #f0f2f5;
    --gray-200: #e1e5eb;
    --gray-300: #c4cad4;
    --gray-400: #9ba3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --text: #1f2937;
    --error: #dc2626;
    --error-bg: #fef2f2;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated background overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(212, 168, 67, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(0, 59, 113, 0.3) 0%, transparent 50%);
    animation: bgShift 15s ease-in-out infinite alternate;
}

@keyframes bgShift {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(-2deg); }
}

/* === Decorative Elements === */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: 
        linear-gradient(30deg, var(--accent) 12%, transparent 12.5%, transparent 87%, var(--accent) 87.5%, var(--accent)),
        linear-gradient(150deg, var(--accent) 12%, transparent 12.5%, transparent 87%, var(--accent) 87.5%, var(--accent));
    background-size: 80px 140px;
}

/* Floating geometric shapes */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
    background: var(--accent);
    animation: floatShape 20s infinite ease-in-out;
}

.shape:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -50px;
    left: -50px;
    animation-delay: -5s;
    background: var(--primary-light);
}

.shape:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 40%;
    left: 5%;
    animation-delay: -10s;
}

@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* === Main Container === */
.main-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: 20px auto;
}

/* === Language Switcher === */
.lang-switcher {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 16px;
    padding: 0 4px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    transition: var(--transition);
    backdrop-filter: blur(10px);
    font-weight: 500;
    letter-spacing: 0.3px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    transform: translateY(-1px);
}

.lang-btn.active {
    background: var(--accent);
    color: var(--primary-dark);
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3);
    font-weight: 600;
}

.lang-btn.active:hover {
    background: var(--accent-light);
}

/* === Bank Card Container === */
.register-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: cardSlideIn 0.6s ease-out;
    position: relative;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* === Card Header === */
.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 35px 40px 30px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.card-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.15), transparent);
    border-radius: 50%;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent);
    border-radius: 50%;
}

.bank-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--gold-gradient);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
    letter-spacing: 0.5px;
}

.bank-logo-text {
    text-align: left;
}

.bank-logo-text h1 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.bank-logo-text .bank-sub {
    color: var(--accent-light);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

.card-header h2 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    font-weight: 500;
    margin: 8px 0 4px;
    position: relative;
    z-index: 1;
}

.card-header .subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.85rem;
    position: relative;
    z-index: 1;
}

/* === Security Badge === */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.security-badge svg {
    width: 14px;
    height: 14px;
    color: var(--accent-light);
}

.security-badge span {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

/* === Card Body === */
.card-body {
    padding: 30px 40px 25px;
}

/* === Form Groups === */
.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group label svg {
    width: 14px;
    height: 14px;
    color: var(--primary);
    flex-shrink: 0;
}

.form-input-wrapper {
    position: relative;
}

.form-input-wrapper .input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--white);
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input::placeholder {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10), var(--shadow-sm);
}

.form-group input.success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-group input.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-group input:disabled {
    background: var(--gray-50);
    cursor: not-allowed;
}

/* Custom select arrow */
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Error message */
.error-message {
    display: none;
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 4px;
    padding-left: 2px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Inline Form Row (Remember Me + Forgot Password) === */
.form-group-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 4px 0;
}

.form-group-inline .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}

.form-group-inline .checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: var(--transition);
}

.form-group-inline .checkbox-label input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-group-inline .checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* === Account Type Cards === */
.account-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.account-card {
    position: relative;
    padding: 14px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    background: var(--white);
    text-align: center;
}

.account-card:hover {
    border-color: var(--primary-20);
    background: var(--primary-10);
    transform: translateY(-1px);
}

.account-card.selected {
    border-color: var(--primary);
    background: var(--primary-10);
    box-shadow: var(--shadow-sm), 0 0 0 3px var(--primary-10);
}

.account-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.account-card-icon { font-size: 1.5rem; margin-bottom: 6px; display: block; }
.account-card-title { font-size: 0.8rem; font-weight: 600; color: var(--text); display: block; margin-bottom: 2px; }
.account-card-desc { font-size: 0.7rem; color: var(--gray-500); display: block; line-height: 1.3; }

.account-card .check-mark {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
}

.account-card.selected .check-mark { background: var(--primary); opacity: 1; }

.account-card .check-mark svg { width: 10px; height: 10px; color: var(--white); }

/* === Password Strength === */
.password-strength { margin-top: 8px; }

.strength-bar-container {
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: var(--radius-full);
    transition: width 0.3s ease, background-color 0.3s ease;
}

.strength-text { font-size: 0.7rem; color: var(--gray-500); font-weight: 500; }

/* === Password Toggle === */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--gray-400);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover { color: var(--gray-600); }
.password-toggle svg { width: 18px; height: 18px; }

/* === Terms Checkbox (for register page) === */
.form-group-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 4px 0;
}

.form-group-checkbox input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--gray-300);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    margin-top: 3px;
    transition: var(--transition);
}

.form-group-checkbox input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.form-group-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid var(--white);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-group-checkbox input[type="checkbox"].error { border-color: var(--error); }

.form-group-checkbox label {
    font-size: 0.8rem;
    color: var(--gray-600);
    cursor: pointer;
    line-height: 1.5;
    user-select: none;
}

/* === Submit Button === */
.submit-btn {
    width: 100%;
    padding: 14px 28px;
    background: var(--gold-gradient);
    color: var(--primary-dark);
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
}

.submit-btn:active { transform: translateY(0); }

.submit-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255, 255, 255, 0.2) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.submit-btn:hover::after { transform: translateX(100%); }

.submit-btn svg { width: 18px; height: 18px; transition: var(--transition); }
.submit-btn:hover svg { transform: translateX(3px); }

/* === Footer === */
.card-footer {
    padding: 20px 40px 30px;
    text-align: center;
    border-top: 1px solid var(--gray-200);
}

.card-footer p { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 8px; }

.card-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.card-footer a:hover { color: var(--primary-light); text-decoration: underline; }

.footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 0.7rem;
    color: var(--gray-400);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.footer-links a:hover { color: var(--primary); }
.footer-links a svg { width: 12px; height: 12px; }

.copyright { font-size: 0.68rem; color: var(--gray-400); margin-top: 12px; }

/* === Flash Messages === */
.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: flashSlideIn 0.4s ease-out;
    position: relative;
}

@keyframes flashSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-message.flash-error {
    background: var(--error-bg);
    border: 1px solid #fecaca;
    color: #991b1b;
}

.flash-message.flash-error svg {
    width: 20px;
    height: 20px;
    color: var(--error);
    flex-shrink: 0;
}

.flash-message span {
    flex: 1;
    line-height: 1.4;
}

.flash-dismiss {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition);
    flex-shrink: 0;
}

.flash-dismiss:hover {
    opacity: 1;
}

/* === Success Overlay === */
.success-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--white);
    z-index: 10;
    border-radius: var(--radius-xl);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
    animation: fadeIn 0.5s ease;
}

.success-overlay.show { display: flex; }

.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: successPop 0.5s ease 0.2s both;
}

@keyframes successPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.success-icon svg { width: 36px; height: 36px; color: var(--success); }
.success-overlay h3 { font-size: 1.4rem; color: var(--text); margin-bottom: 8px; }
.success-overlay p { color: var(--gray-500); font-size: 0.9rem; max-width: 300px; }

/* === Responsive === */
@media (max-width: 600px) {
    body { padding: 10px; align-items: flex-start; }
    .main-container { margin: 10px auto; }
    .card-header { padding: 24px 20px 20px; }
    .card-body { padding: 20px 20px 15px; }
    .card-footer { padding: 15px 20px 20px; }
    .bank-logo-text h1 { font-size: 1rem; }
    .card-header h2 { font-size: 1.1rem; }
    .account-type-selector { grid-template-columns: 1fr; }
    .lang-btn { padding: 5px 10px; font-size: 0.7rem; }
    .form-group { margin-bottom: 14px; }
    .form-group input,
    .form-group select { padding: 10px 12px 10px 36px; font-size: 0.85rem; }
}

@media (max-width: 400px) {
    .card-header { padding: 20px 16px 16px; }
    .card-body { padding: 16px; }
    .card-footer { padding: 12px 16px 16px; }
    .register-card { border-radius: var(--radius-lg); }
}

/* === iPhone / iOS Compatiblity === */
@supports (-webkit-touch-callout: none) {
    body, .site-wrapper, .chatbot-window, .chatbot-messages {
        -webkit-overflow-scrolling: touch;
    }
    .navbar {
        padding-top: calc(18px + env(safe-area-inset-top, 0px));
        padding-left: calc(60px + env(safe-area-inset-left, 0px));
        padding-right: calc(60px + env(safe-area-inset-right, 0px));
    }
    .chatbot-window.open {
        height: -webkit-fill-available;
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 20px);
    }
    .hero {
        min-height: calc(520px + env(safe-area-inset-top, 0px));
    }
}

* {
    -webkit-tap-highlight-color: transparent;
}

input, textarea, button, select {
    font-size: 16px !important;
}

@media (hover: none) and (pointer: coarse) {
    .nav-links a, .lang-btn, .card, .security-item, .quick-reply-btn, .chatbot-send-btn {
        cursor: default;
    }
    .card:hover, .security-item:hover, .nav-links a:hover {
        transform: none;
    }
}

/* === Print === */
@media print {
    body { background: var(--white); padding: 0; }
    .register-card { box-shadow: none; border: 1px solid var(--gray-200); }
    .lang-switcher { display: none; }
    .submit-btn { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ============================================
   Live Chatbot Widget
   ============================================ */

/* Chat bubble (floating button) */
.chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gold-gradient);
    border: none;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.4);
    transition: var(--transition);
    animation: chatbotPulse 2s ease-in-out infinite;
}

.chatbot-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(212, 168, 67, 0.55);
}

.chatbot-bubble svg {
    width: 28px;
    height: 28px;
    color: var(--primary-dark);
}

.chatbot-bubble .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--error);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

@keyframes chatbotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Chat window */
.chatbot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 360px;
    height: 520px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatbotSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.chatbot-window.open {
    display: flex;
}

@keyframes chatbotSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Chat header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chatbot-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: var(--gold-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--primary-dark);
    flex-shrink: 0;
}

.chatbot-header-info h3 {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.chatbot-header-info .status {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.chatbot-header-info .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
    animation: statusPulse 1.5s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.chatbot-close svg {
    width: 16px;
    height: 16px;
}

/* Chat messages area */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--gray-50);
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Message bubbles */
.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.5;
    animation: messageSlide 0.3s ease-out;
    word-wrap: break-word;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    align-self: flex-start;
    background: var(--white);
    color: var(--text);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.message.bot .message-sender {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
    display: block;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: var(--white);
    border-bottom-right-radius: 4px;
}

.message.user .message-sender {
    display: none;
}

.message-time {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
    text-align: right;
}

/* Typing indicator */
.typing-indicator {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--white);
    border-radius: var(--radius-md);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--gray-400);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Quick reply buttons */
.chatbot-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 16px 12px;
    background: var(--gray-50);
    flex-shrink: 0;
}

.quick-reply-btn {
    padding: 6px 14px;
    border: 1.5px solid var(--primary-20);
    background: var(--white);
    color: var(--primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.quick-reply-btn:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Chat input area */
.chatbot-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition);
    color: var(--text);
    background: var(--gray-50);
}

.chatbot-input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-10);
}

.chatbot-input::placeholder {
    color: var(--gray-400);
}

.chatbot-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gold-gradient);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(212, 168, 67, 0.3);
}

.chatbot-send-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(212, 168, 67, 0.4);
}

.chatbot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-send-btn svg {
    width: 18px;
    height: 18px;
    color: var(--primary-dark);
}

/* Chatbot responsive */
@media (max-width: 480px) {
    .chatbot-window {
        bottom: 0;
        right: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .chatbot-bubble {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
    
    .chatbot-bubble svg {
        width: 24px;
        height: 24px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .chatbot-window {
        width: 340px;
        height: 480px;
        right: 16px;
        bottom: 90px;
    }
}


