/* Apple M3 Expressive Design System - Restrained Version */
:root {
    --bg-base: #000000;
    --bg-surface: #1c1c1e;
    --bg-surface-hover: #2c2c2e;
    --border-color: #38383a;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-blue: #0a84ff;
    --accent-blue-subtle: rgba(10, 132, 255, 0.1);
    --accent-green: #30d158;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

body {
    margin: 0;
    padding: 20px;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    height: 100vh;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
}

.header {
    text-align: left;
    padding: 10px 0 5px 0;
}

.header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 6px 0;
    letter-spacing: -0.3px;
}

.header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.editor-card {
    flex-grow: 1;
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease;
}

.editor-card:focus-within {
    border-color: #48484a;
}

/* === QUILL CUSTOMIZATION === */
.ql-toolbar.ql-snow {
    border: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    background-color: rgba(28, 28, 30, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px 14px !important;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    z-index: 10;
}

.ql-container.ql-snow {
    border: none !important;
    font-size: 16px;
    font-family: inherit;
    background-color: transparent;
    flex-grow: 1;
}

.ql-editor {
    padding: 24px 20px !important;
    line-height: 1.6;
    color: var(--text-primary);
}

.ql-editor.ql-blank::before {
    color: var(--text-secondary);
    font-style: normal;
    left: 20px !important;
    right: 20px !important;
}

/* Icons & Pickers */
.ql-snow .ql-stroke { stroke: #a1a1a6 !important; }
.ql-snow .ql-fill { fill: #a1a1a6 !important; }
.ql-snow .ql-picker { color: #a1a1a6 !important; }

button.ql-active .ql-stroke { stroke: var(--accent-blue) !important; }
button:hover .ql-stroke { stroke: var(--text-primary) !important; }

.ql-snow .ql-picker-options {
    background-color: #2c2c2e !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5) !important;
    padding: 6px 0 !important;
    z-index: 1000 !important;
}

.ql-snow .ql-picker-item {
    color: var(--text-primary) !important;
    padding: 6px 14px !important;
}

.ql-snow .ql-picker-item:hover {
    background-color: #3a3a3c !important;
}

/* === RESTRAINED ACTION BUTTON === */
.footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 0 20px 0;
}

.action-button {
    background-color: #2c2c2e; /* Сдержанный серый фон */
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease-in-out;
}

.action-button:hover {
    background-color: #3a3a3c;
    border-color: #48484a;
}

.action-button:active {
    background-color: #1c1c1e;
    transform: translateY(1px);
}

.action-button span {
    letter-spacing: 0.2px;
}

.action-button .icon-send {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

.action-button:disabled {
    background-color: #1c1c1e;
    color: #48484a;
    border-color: #2c2c2e;
    cursor: not-allowed;
}

/* Success Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.success-card {
    background-color: #1c1c1e;
    border: 1px solid var(--border-color);
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    max-width: 300px;
    animation: popIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.success-card h2 {
    margin: 16px 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.success-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* Checkmark */
.checkmark {
    width: 52px;
    height: 52px;
    margin: 0 auto;
}

.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke: var(--accent-green);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: var(--accent-green);
    stroke-width: 3;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.9); } 100% { opacity: 1; transform: scale(1); } }

.ql-editor::-webkit-scrollbar { width: 5px; }
.ql-editor::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
