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

body {
    font-family: "Poppins", sans-serif;
    background: white;
    min-height: 100vh;
    padding: 10px;
}

textarea::placeholder,
input::placeholder,
select::placeholder,
select {
    font-family: "Poppins", sans-serif;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.header {
    background: #16a4ee;
    padding: 12px 15px;
    text-align: center;
    color: white;
}

.header img {
    background-color: white;
    border-radius: 8px;
    margin-bottom: 0;
}

.header .header-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.header .header-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0px;
    flex: 1;
}

.header h1 {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.header p {
    font-size: 0.85rem;
    text-align: left;
    margin: 0 0 2px 0;
    line-height: 1.3;
}

.form-container {
    padding: 20px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: black;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: white;
    color: black;
    box-shadow: inset 0 0 5px rgba(22, 164, 238, 0.34);
    line-height: 1.2;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4facfe;
    background: white;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: black;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
    padding: 8px 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.submit-btn {
    width: 100%;
    background: #16a4ee;
    color: white;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    background: black;
}

.submit-btn:active {
    transform: translateY(0);
}

.token-info {
    background: #e8f5e8;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #28a745;
}

.token-info h3 {
    color: #155724;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.token-info p {
    color: #155724;
    font-size: 0.85rem;
    word-break: break-all;
}

.lang-label {
    font-size: 0.75rem;
    font-weight: 400;
    color: #333;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .container {
        margin: 5px;
    }

    .form-container {
        padding: 15px;
    }

    .header {
        padding: 10px;
    }

    .header h1 {
        font-size: 1.2rem;
        margin-bottom: 3px;
    }

    .form-group {
        margin-bottom: 10px;
    }

    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
}

.error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 5px;
}

.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message .close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #721c24;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0 5px;
}

.error-message .close-btn:hover {
    color: #491217;
}

/* Speech-to-text styles */
.input-with-mic {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-mic input,
.input-with-mic textarea {
    flex: 1;
}

/* Special alignment for textarea */
.input-with-mic:has(textarea) {
    align-items: flex-start;
}

.mic-btn {
    background: linear-gradient(135deg, #16a4ee 0%, #1290d4 100%);
    border: none;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    min-width: 42px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(22, 164, 238, 0.25);
    position: relative;
}

.mic-btn:hover {
    background: linear-gradient(135deg, #1290d4 0%, #0f7db8 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 164, 238, 0.35);
}

.mic-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(22, 164, 238, 0.25);
}

.mic-btn.recording {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    animation: pulse 1.5s infinite;
}

.mic-btn.recording:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

.mic-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

@keyframes pulse {
    0% {
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 20px rgba(220, 53, 69, 0.8), 0 0 30px rgba(220, 53, 69, 0.4);
        transform: scale(1.05);
    }

    100% {
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
        transform: scale(1);
    }
}

/* Microphone status indicator */
.mic-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #666;
    margin-top: 3px;
}

.mic-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
}

.mic-status-dot.connected {
    background: #28a745;
    animation: blink 2s infinite;
}

.mic-status-dot.disconnected {
    background: #dc3545;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}