/* ======================================================
 *  TALK TO EMMA MODAL STYLES (Light & Professional Theme)
 * ====================================================== */

/* Overlay & Backdrop */
.demo-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.demo-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Modal Window */
.demo-modal {
    position: relative;
    z-index: 1;
    width: 92%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 12px;
    padding: 2.5rem 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    animation: demo-modal-in 0.3s ease-out;
    color: #60616c;
}

@keyframes demo-modal-in {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Close Button */
.demo-close-btn {
    position: absolute;
    top: 15px; right: 15px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: none;
    background: #f0f2f4;
    color: #123f78;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}
.demo-close-btn:hover {
    background: #e2e6eb;
    color: #a52727;
}

/* Step Header */
.demo-step-header {
    text-align: center;
    margin-bottom: 2rem;
}
.demo-icon-badge {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(18, 63, 120, 0.08);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.2rem;
    color: #123f78;
}
.demo-icon-badge-success {
    background: rgba(69, 208, 189, 0.15);
    color: #45D0BD;
}
.demo-title {
    font-family: 'Sora', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #000662;
    margin: 0 0 0.5rem;
}
.demo-subtitle {
    font-size: 0.95rem;
    color: #60616c;
    margin: 0;
    line-height: 1.5;
}
.demo-subtitle strong {
    color: #123f78;
    font-weight: 600;
}

/* Form Fields */
.demo-field {
    margin-bottom: 1.2rem;
    text-align: left;
}
.demo-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #000662;
    margin-bottom: 0.4rem;
}
.demo-field input,
.demo-field select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    border: 1px solid #cfddde;
    background: #ffffff;
    color: #111315;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s;
    outline: none;
    box-sizing: border-box;
}
.demo-field input::placeholder {
    color: #b5b5bc;
}
.demo-field input:focus,
.demo-field select:focus {
    border-color: #123f78;
    box-shadow: 0 0 0 3px rgba(18, 63, 120, 0.1);
}

/* Error Text */
.demo-error {
    color: #a52727;
    font-size: 0.85rem;
    margin: 0 0 1rem;
    min-height: 1.2em;
    text-align: center;
}

/* Primary Button */
.demo-btn-primary {
    width: 100%;
    padding: 0.9rem;
    border: none;
    border-radius: 6px;
    background: #123f78;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    font-family: 'Sora', sans-serif;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    transition: all 0.3s;
}
.demo-btn-primary:hover {
    background: #000662;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(18, 63, 120, 0.2);
}
.demo-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* OTP Inputs */
.demo-otp-inputs {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.demo-otp-digit {
    width: 50px; height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid #cfddde;
    background: #f0f2f4;
    color: #123f78;
    outline: none;
    transition: all 0.2s;
}
.demo-otp-digit:focus {
    border-color: #123f78;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(18, 63, 120, 0.1);
}

/* Resend OTP */
.demo-resend-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}
.demo-resend-text {
    font-size: 0.9rem;
    color: #60616c;
}
.demo-resend-btn {
    font-size: 0.9rem;
    font-weight: 600;
    color: #123f78;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s;
}
.demo-resend-btn:hover {
    color: #000662;
}
.demo-resend-btn:disabled {
    color: #b5b5bc;
    cursor: not-allowed;
    text-decoration: none;
}

/* Voice Interaction */
.demo-voice-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0;
}

.voice-pulse-wrapper {
    position: relative;
    width: 160px; height: 160px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2rem;
}

.voice-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(18, 63, 120, 0.15);
    transition: all 0.4s ease;
}
.voice-ring-1 { width: 100%; height: 100%; inset: 0; }
.voice-ring-2 { width: 75%; height: 75%; top: 12.5%; left: 12.5%; border-color: rgba(18, 63, 120, 0.25); }
.voice-ring-3 { width: 50%; height: 50%; top: 25%; left: 25%; border-color: rgba(18, 63, 120, 0.35); }

.voice-core {
    position: relative;
    z-index: 2;
    width: 60px; height: 60px;
    border-radius: 50%;
    background: #123f78;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 5px 15px rgba(18, 63, 120, 0.3);
}

/* Connecting State */
.voice-pulse-wrapper.state-connecting .voice-ring {
    animation: ring-pulse-idle 2s ease-in-out infinite;
}
@keyframes ring-pulse-idle {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* Listening State (Cyan/Teal) */
.voice-pulse-wrapper.state-listening .voice-ring {
    border-color: rgba(69, 208, 189, 0.3);
    border-width: 2px;
    animation: ring-breathe 1.8s ease-in-out infinite;
}
.voice-pulse-wrapper.state-listening .voice-core {
    background: #45D0BD;
    box-shadow: 0 0 25px rgba(69, 208, 189, 0.5);
}
@keyframes ring-breathe {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

/* Speaking State (Primary Blue) */
.voice-pulse-wrapper.state-speaking .voice-ring {
    border-color: rgba(18, 63, 120, 0.4);
    border-width: 2px;
}
.voice-pulse-wrapper.state-speaking .voice-ring-1 { animation: ring-expand 1.2s ease-out infinite; }
.voice-pulse-wrapper.state-speaking .voice-ring-2 { animation: ring-expand 1.2s ease-out infinite 0.2s; }
.voice-pulse-wrapper.state-speaking .voice-ring-3 { animation: ring-expand 1.2s ease-out infinite 0.4s; }
.voice-pulse-wrapper.state-speaking .voice-core {
    background: #123f78;
    box-shadow: 0 0 30px rgba(18, 63, 120, 0.6);
}
@keyframes ring-expand {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 0; }
}

/* Status Label */
.voice-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: #60616c;
    margin: 0 0 2rem;
    transition: color 0.3s;
}
.voice-status.status-listening { color: #45D0BD; }
.voice-status.status-speaking { color: #123f78; }
.voice-status.status-connected { color: #123f78; }

/* End Call Button */
.demo-btn-end {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1.8rem;
    border-radius: 25px;
    border: 2px solid #a52727;
    background: #ffffff;
    color: #a52727;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.demo-btn-end:hover {
    background: #a52727;
    color: #ffffff;
}

@media (max-width: 650px) {
    .demo-modal {
        width: 95%;
        padding: 1.8rem 1.5rem;
    }
    .demo-otp-digit {
        width: 42px; height: 52px;
        font-size: 1.2rem;
    }
    .voice-pulse-wrapper {
        width: 140px; height: 140px;
    }
}
