/*
 * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
 * See LICENSE in the project root for license information.
 */

:root {
    --gold: #C9A84C;
    --gold-dark: #8B6914;
    --ink: #1A1814;
    --cream: #FDFAF4;
    --ink-soft: #3D3A34;
    --ink-muted: #7A776E;
    --green: #4CAF50;
    --red: #E24B4A;
    --orange: #E8A020;
    --blue: #2C5F8A;
    --purple: #6B3FA0;

    --doctype-modern-native: #4CAF50;
    --doctype-modern-scan: #2196F3;
    --doctype-old-print: #FF9800;
    --doctype-very-old: #9C27B0;
    --doctype-scan-vision: #2196F3;
}

 html,
 body {
     width: 100%;
     height: 100%;
     margin: 0;
     padding: 0;
 }
 
 ul {
     margin: 0;
     padding: 0;
 }
 
 .ms-welcome__header {
    padding: 8px 16px;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: row;
    flex-direction: row;
    -webkit-justify-content: center;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: var(--ink);
    border-top: 3px solid var(--gold);
    border-bottom: 3px solid var(--gold);
 }

 .ms-welcome__header img {
    width: 32px;
    height: 32px;
 }

 body.ms-welcome {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    height: 100%;
    background: var(--cream);
    color: var(--ink);
 }

 .ms-welcome__main {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-flex: 1 0 0;
    flex: 1 0 0;
    padding: 10px 20px;
 }

 .section-divider {
     border: none;
     border-top: 1px solid var(--gold);
     margin: 0 0 14px 0;
 }

 .mail-field {
     margin-bottom: 14px;
 }

 .mail-field--tight {
     margin-bottom: 4px;
 }

 .recipient-block {
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .recipient-info {
     -ms-flex: 1 1 auto;
     flex: 1 1 auto;
     min-width: 0;
 }

 .recipient-row {
     display: flex;
     align-items: baseline;
     gap: 6px;
 }

 .label-large {
     font-size: 1em;
 }

 .recipient-name {
     color: var(--ink);
     font-weight: 600;
 }

 .recipient-email {
     color: var(--ink-muted);
     font-size: 0.9em;
 }

 .mail-field--grow {
     flex: 1 0 auto;
     display: flex;
     flex-direction: column;
     min-height: 0;
 }

 .mail-value {
     margin: 4px 0 0 0;
 }

 .ms-welcome__main > h2 {
     width: 100%;
     text-align: center;
 }

b {
    font-weight: 600;
    color: var(--gold-dark);
    text-transform: uppercase;
    font-size: 0.78em;
    letter-spacing: 0.06em;
}

.is-hidden {
    display: none;
}

[role="button"]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.is-disabled {
    opacity: 0.6;
    cursor: default;
    animation: none;
}

.generate-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#insert-reply,
#license-retry,
#identity-retry,
#technical-retry,
#settings-save,
#user-info-save {
    display: inline-block;
    background: var(--cream);
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 6px 16px;
    margin: 4px 0;
    cursor: pointer;
}

.generate-row #settings-save,
.generate-row #user-info-save {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    text-align: center;
}

#license-error,
#identity-error,
#technical-error {
    align-items: center;
    text-align: center;
    padding-top: 32px;
    gap: 6px;
}

#license-error .icon-error,
#identity-error .icon-error,
#technical-error .icon-error {
    color: var(--red);
    margin-bottom: 4px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

#license-error h2,
#identity-error h2,
#technical-error h2 {
    font-weight: 700;
}

#license-error p,
#identity-error p,
#technical-error p {
    color: var(--ink-soft);
    line-height: 1.6;
    margin: 8px 0 20px;
    padding: 0 12px;
}

#license-retry,
#identity-retry,
#technical-retry {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    text-align: center;
    width: 140px;
    height: 20px;
}

#insert-reply {
    display: -webkit-flex;
    display: flex;
    -webkit-justify-content: center;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.icon-mail {
    color: var(--ink);
}

.has-halo {
    animation: praetor-halo 2.6s ease-in-out infinite;
}

@keyframes praetor-halo {
    0%,
    100% {
        box-shadow:
            0 0 0 0 rgba(201, 168, 76, 0.55),
            0 0 10px 2px rgba(139, 105, 20, 0.35),
            inset 0 0 4px rgba(253, 250, 244, 0.6);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(201, 168, 76, 0.22),
            0 0 20px 5px rgba(139, 105, 20, 0.45),
            inset 0 0 6px rgba(253, 250, 244, 0.8);
    }
}

.generate-reply-loading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.generate-reply-loading.is-hidden {
    display: none;
}

#generate-reply-label {
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#generate-reply-label.is-hidden {
    display: none;
}

#insert-reply .ms-Button-label,
#license-retry .ms-Button-label,
#identity-retry .ms-Button-label,
#technical-retry .ms-Button-label,
#settings-save .ms-Button-label,
#user-info-save .ms-Button-label {
    color: var(--ink);
    font-weight: 600;
}

#insert-reply:hover,
#license-retry:hover,
#identity-retry:hover,
#technical-retry:hover,
#settings-save:hover,
#user-info-save:hover {
    background: var(--gold);
    border-color: var(--gold-dark);
}

#insert-reply:hover .ms-Button-label,
#license-retry:hover .ms-Button-label,
#identity-retry:hover .ms-Button-label,
#technical-retry:hover .ms-Button-label,
#settings-save:hover .ms-Button-label,
#user-info-save:hover .ms-Button-label {
    color: #ffffff;
}

#insert-reply:hover .icon-mail {
    color: #ffffff;
}

#license-retry:hover .spinner,
#identity-retry:hover .spinner,
#technical-retry:hover .spinner {
    border-color: #ffffff;
    border-top-color: transparent;
}

.toolbar-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--gold);
}

.ai-disclaimer {
    color: var(--ink-muted);
    font-size: 0.75em;
    font-style: italic;
    margin: 4px 0 0;
}

.toolbar-brand {
    color: var(--ink-muted);
    font-size: 0.75em;
    letter-spacing: 0.03em;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.round-icon-button {
    display: inline-flex;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin: 4px 0;
    background: transparent;
    border: 1px solid var(--gold-dark);
    border-radius: 50%;
    color: var(--ink-soft);
    cursor: pointer;
}

.round-icon-button--small {
    width: 18px;
    height: 18px;
}

.round-icon-button:hover {
    background: var(--cream);
    border-color: var(--gold);
    color: var(--gold-dark);
}

.round-icon-button.is-hidden {
    display: none;
}

.round-icon-button.is-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--cream);
    border: 1px solid var(--gold-dark);
    border-radius: 22px;
    padding: 5px 5px 5px 10px;
}

.chat-input-bar:focus-within {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

.chat-input-bar .round-icon-button {
    margin: 0;
}

.chat-input-textarea {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    box-sizing: border-box;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    font-family: inherit;
    font-size: inherit;
    color: var(--ink);
    padding: 7px 0;
    height: 30px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 16px;
}

.chat-input-textarea::placeholder {
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-input-send {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gold);
    border: 1px solid var(--gold-dark);
    color: var(--ink);
    cursor: pointer;
}

.chat-input-send:hover {
    background: var(--gold-dark);
    color: #ffffff;
}

.chat-input-send .spinner {
    border-color: #ffffff;
    border-top-color: transparent;
}

.chat-input-send.is-disabled {
    opacity: 0.5;
    cursor: default;
    animation: none;
}

.chat-input-send-icon {
    display: -webkit-inline-flex;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-input-send-icon.is-hidden {
    display: none;
}

#generate-reply-loading,
#generate-reply-cancel {
    display: none;
}

.chat-input-send.is-loading #generate-reply-label {
    display: none;
}

.chat-input-send.is-loading #generate-reply-loading {
    display: inline-flex;
}

.chat-input-send.is-loading:hover #generate-reply-loading {
    display: none;
}

.chat-input-send.is-loading:hover #generate-reply-cancel {
    display: inline-flex;
}

.chat-input-send.is-loading:hover {
    background: var(--red);
    border-color: var(--red);
}

#dictate-instruction.is-recording {
    border-color: var(--red);
    color: var(--red);
    animation: praetor-recording-pulse 1.2s ease-in-out infinite;
}

@keyframes praetor-recording-pulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(226, 75, 74, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(226, 75, 74, 0.15);
    }
}

.reply-instruction {
    -ms-flex: none;
    flex: none;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    background: var(--cream);
    color: var(--ink);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    padding: 8px;
    margin: 4px 0 0 0;
}

.reply-instruction:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}

#settings-consigne {
    min-height: 240px;
}

#user-info-office {
    min-height: 70px;
    font-size: 1.05em;
}

#settings-page h2,
#user-info-page h2 {
    color: var(--gold-dark);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--gold);
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--gold);
    border-top-color: transparent;
    border-radius: 50%;
    animation: praetor-spin 0.7s linear infinite;
}

@keyframes praetor-spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner.is-hidden {
    display: none;
}

.reply-status {
    font-size: 0.9em;
    color: var(--ink-muted);
    margin: 6px 0;
    white-space: normal;
    overflow-wrap: break-word;
}

.reply-status--error {
    color: var(--red);
}

.attachments-status {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: normal;
}

.attachments-status.is-hidden {
    display: none;
}

#attachments-status-text {
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: break-word;
}

.reply-text {
    -ms-flex: 1 0 auto;
    flex: 1 0 auto;
    min-height: 160px;
    resize: vertical;
    font-family: inherit;
    font-size: inherit;
    background: var(--cream);
    color: var(--ink);
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    padding: 8px;
    margin: 4px 0 0 0;
}

.reply-text:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold);
}