/* ===== ОБЩИЕ АНИМАЦИИ ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* ===== ОБЩИЕ СТИЛИ КОНТЕЙНЕРОВ ===== */
.modern-container {
    max-width: 100%;
    margin: 0;
    padding: 16px;
    animation: fadeInUp 0.6s ease-out;
}

.modern-header {
    text-align: center;
    margin-bottom: 32px;
    animation: scaleIn 0.8s ease-out 0.2s both;
}

.modern-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 0 8px 25px rgba(36, 129, 204, 0.3);
}

.modern-icon.form-icon {
    background: linear-gradient(135deg, var(--tg-theme-button-color, #2481cc), rgba(36, 129, 204, 0.8));
}

.modern-icon.success-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    border-radius: 50%;
    font-size: 40px;
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

.modern-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.modern-subtitle {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin: 0;
    line-height: 1.4;
}

.modern-card {
    background: var(--tg-theme-bg-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

/* ===== СТИЛИ ФОРМЫ ===== */
.form-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.6s ease-out calc(0.6s + var(--delay, 0) * 0.1s) both;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-text-color);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-textarea {
    width: 100%;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 16px;
    line-height: 1.5;
    box-sizing: border-box;
    transition: all 0.3s ease;
    font-family: inherit;
    resize: none;
}

.form-textarea {
    min-height: 120px;
    max-height: 200px;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
    box-shadow: 0 0 0 4px rgba(36, 129, 204, 0.1);
    transform: translateY(-2px);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--tg-theme-hint-color);
    opacity: 0.7;
}

/* ===== СТИЛИ ЗАГРУЗКИ ФАЙЛОВ ===== */
.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

.file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px dashed rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    background: rgba(116, 185, 255, 0.05);
    color: var(--tg-theme-text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 16px;
    min-height: 60px;
}

.file-input-label:hover {
    border-color: var(--tg-theme-button-color);
    background: rgba(116, 185, 255, 0.1);
    transform: translateY(-2px);
}

.file-input-icon {
    margin-right: 12px;
    font-size: 20px;
    opacity: 0.7;
}

.file-list {
    margin-top: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.2);
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--tg-theme-text-color);
    animation: fadeInUp 0.3s ease-out;
    transition: all 0.2s ease;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item:hover {
    background: rgba(116, 185, 255, 0.15);
    transform: translateY(-1px);
}

.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.file-icon {
    margin-right: 10px;
    font-size: 16px;
    opacity: 0.8;
}

.file-remove {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 16px;
}

.file-remove:hover {
    background: rgba(255, 71, 87, 0.1);
    transform: scale(1.1);
}

/* ===== СТИЛИ КНОПОК ===== */
.submit-button {
    width: 100%;
    background: linear-gradient(135deg, var(--tg-theme-button-color, #2481cc), rgba(36, 129, 204, 0.8));
    color: var(--tg-theme-button-text-color, #fff);
    border: none;
    border-radius: 16px;
    padding: 18px 24px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(36, 129, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(36, 129, 204, 0.4);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.submit-button.loading {
    background: linear-gradient(
        90deg,
        rgba(36, 129, 204, 0.8) 0%,
        rgba(36, 129, 204, 1) 50%,
        rgba(36, 129, 204, 0.8) 100%
    );
    background-size: 200px 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ===== СТИЛИ СООБЩЕНИЙ ===== */
.error-message {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.1), rgba(255, 71, 87, 0.05));
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: #ff4757;
    border-radius: 16px;
    padding: 16px 20px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    animation: fadeInUp 0.3s ease-out;
}

.sending-message {
    color: var(--tg-theme-button-color);
    text-align: center;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== СТИЛИ ИНФОРМАЦИОННЫХ КАРТОЧЕК ===== */
.info-card {
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.1), rgba(76, 175, 80, 0.1));
    border: 1px solid rgba(116, 185, 255, 0.2);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.8s both;
}

.info-text {
    font-size: 15px;
    color: var(--tg-theme-text-color);
    line-height: 1.5;
    margin: 0;
}

.info-highlight {
    font-weight: 600;
    color: var(--tg-theme-button-color);
}

/* ===== СТИЛИ ДЕТАЛЕЙ (для страницы успеха) ===== */
.detail-item {
    margin-bottom: 20px;
    animation: fadeInUp 0.6s ease-out calc(0.6s + var(--delay, 0) * 0.1s) both;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--tg-theme-hint-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.detail-value {
    font-size: 16px;
    color: var(--tg-theme-text-color);
    line-height: 1.5;
    word-wrap: break-word;
}

/* ===== ТЕМНАЯ ТЕМА ===== */
@media (prefers-color-scheme: dark) {
    .modern-card {
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .form-input,
    .form-textarea {
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .file-input-label {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(116, 185, 255, 0.1);
    }
    
    .file-input-label:hover {
        background: rgba(116, 185, 255, 0.15);
    }
    
    .file-item {
        background: rgba(116, 185, 255, 0.15);
        border-color: rgba(116, 185, 255, 0.3);
    }
    
    .file-item:hover {
        background: rgba(116, 185, 255, 0.2);
    }
    
    .info-card {
        background: linear-gradient(135deg, rgba(116, 185, 255, 0.15), rgba(76, 175, 80, 0.15));
        border-color: rgba(116, 185, 255, 0.3);
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 360px) {
    .modern-container {
        padding: 16px;
    }
    
    .modern-card {
        padding: 20px;
    }
    
    .modern-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
    }
    
    .modern-icon.success-icon {
        width: 70px;
        height: 70px;
        font-size: 35px;
    }
    
    .modern-title {
        font-size: 24px;
    }
    
    .submit-button {
        padding: 16px 20px;
        font-size: 16px;
    }
}