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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1A1A1A;
    color: #e0e0e0;
    height: 100dvh;
}

.screen {
    display: none;
    height: 100dvh;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* CARD (formulario e final) */
.card {
    width: 85%;
    max-width: 420px;
}

.logo {
    text-align: center;
    margin-bottom: 16px;
} 

.logo h1 {
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
}

/* FORM */
form#form-register {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

form#form-register input {
    color: #E6E6E6;
    padding: 10.732px 16.992px;
    border-radius: 10.732px;
    background: #161616;
    box-shadow: 0 3.577px 8.138px 0 rgba(0, 0, 0, 0.45) inset, 0 -0.894px 0.894px 0 rgba(255, 255, 255, 0.25) inset;
    border: none;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

form#form-register input:-webkit-autofill,
form#form-register input:-webkit-autofill:hover,
form#form-register input:-webkit-autofill:focus,
form#form-register input:-webkit-autofill:active {
    -webkit-text-fill-color: #E6E6E6;
    -webkit-box-shadow: 0 0 0 1000px #161616 inset;
    transition: background-color 9999s ease-in-out 0s;
    box-shadow: 0 3.577px 8.138px 0 rgba(0, 0, 0, 0.45) inset, 0 -0.894px 0.894px 0 rgba(255, 255, 255, 0.25) inset;
}

form#form-register input:focus {
   background: #1A1A1A;
}

form#form-register input::placeholder {
    color: #666;
}

button {
    background: #E6E6E6;
    color: #161616;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button:hover {
    background: #3a8eef;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* CHAT */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.chat-header h2 {
    font-size: 1.2rem;
    color: #fff;
}

.btn-finish {
    background: #333;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 6px;
}

.btn-finish:hover {
    background: #444;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 10.732px;
    font-size: 0.9rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.msg.user {
    align-self: flex-end;
    background: #E6E6E6;
    color: #161616;
    border-bottom-right-radius: 3px;
}

.msg.assistant {
    align-self: flex-start;
    background: #161616;
    color: #E6E6E6;
    border-bottom-left-radius: 3px;
    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.3) inset, 0 -0.5px 0.5px 0 rgba(255, 255, 255, 0.15) inset;
}

.msg.typing {
    align-self: flex-start;
    background: #222;
    color: #888;
    font-style: italic;
}

.chat-input {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #2a2a2a;
    align-items: center;
    flex-shrink: 0;
}

.chat-input input {
    flex: 1;
    color: #E6E6E6;
    padding: 10.732px 16.992px;
    border-radius: 10.732px;
    background: #161616;
    box-shadow: 0 3.577px 8.138px 0 rgba(0, 0, 0, 0.45) inset, 0 -0.894px 0.894px 0 rgba(255, 255, 255, 0.25) inset;
    border: none;
    font-size: 1rem;
    outline: none;
}

.chat-input input:focus {
    background: #1A1A1A;
}

.btn-send {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10.732px;
    background: #E6E6E6;
    color: #161616;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: #fff;
}

.btn-send:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-mic {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 10.732px;
    background: #2a2a2a;
    color: #E6E6E6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-mic:hover {
    background: #333;
}

.btn-mic.recording {
    background: #c0392b;
    color: #fff;
    animation: pulse 1s infinite;
}

.btn-mic.transcribing {
    background: #2a2a2a;
    color: transparent;
    position: relative;
    cursor: not-allowed;
}

.btn-mic.transcribing::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid #555;
    border-top-color: #E6E6E6;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

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

/* SUMMARY */
.summary-box {
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    line-height: 1.8;
    font-size: 0.9rem;
    color: #ccc;
}

.summary-field {
    padding: 4px 0;
}

.summary-field strong {
    color: #4a9eff;
}

.summary-divider {
    border-top: 1px solid #2a2a2a;
    margin: 12px 0;
}

.summary-text {
    color: #e0e0e0;
    font-size: 0.95rem;
}

.btn-download {
    display: block;
    width: 100%;
    background: #4a9eff;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #3a8eef;
}

.btn-restart {
    width: 100%;
    background: #333;
}

.btn-restart:hover {
    background: #444;
}

/* AUDIO PREVIEW */
.audio-preview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #161616;
    border-radius: 10.732px;
    padding: 6px 12px;
    box-shadow: 0 3.577px 8.138px 0 rgba(0, 0, 0, 0.45) inset, 0 -0.894px 0.894px 0 rgba(255, 255, 255, 0.25) inset;
}

.btn-audio-play {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: #E6E6E6;
    color: #161616;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s;
}

.btn-audio-play:hover {
    background: #fff;
}

.audio-time {
    font-size: 0.85rem;
    color: #888;
    min-width: 32px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.btn-audio-delete {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: transparent;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
    margin-left: auto;
}

.btn-audio-delete:hover {
    background: #2a2a2a;
    color: #c0392b;
}
