/**
 * CloudTech Auto Grading - Form Styles
 */

/* コンテナ */
.ctg-grading-form-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ヘッダー */
.ctg-header h3 {
    margin: 0 0 0.5rem 0;
    color: #1a1a2e;
    font-size: 1.5rem;
}

.ctg-description {
    color: #666;
    margin-bottom: 1.5rem;
}

/* 通知メッセージ */
.ctg-notice {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.ctg-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.ctg-notice-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.ctg-notice-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ctg-notice-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* 採点回数表示 */
.ctg-limit-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.ctg-limit-label {
    font-weight: 600;
    color: #495057;
}

.ctg-limit-count {
    color: #007bff;
    font-weight: 700;
}

.ctg-limit-remaining {
    color: #28a745;
}

/* ExternalId セクション */
.ctg-external-id-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.ctg-external-id-section h4 {
    margin: 0 0 1rem 0;
    color: #1e40af;
    font-size: 1.2rem;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 0.5rem;
}

/* 情報ボックス */
.ctg-info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 4px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.ctg-info-box p {
    margin: 0.5rem 0;
    color: #1e40af;
}

.ctg-info-box p:first-child {
    margin-top: 0;
}

.ctg-info-box p:last-child {
    margin-bottom: 0;
}

.ctg-small-text {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
}

/* ステップ説明 */
.ctg-step-instruction {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.ctg-step-instruction p {
    margin: 1rem 0;
    line-height: 1.7;
}

.ctg-step-instruction p:first-child {
    margin-top: 0;
}

/* プライマリボタン */
.ctg-btn-primary {
    display: inline-block;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff !important;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.ctg-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    color: #fff !important;
}

/* チェックボックスラベル表示 */
.ctg-checkbox-label {
    display: inline-block;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #475569;
    margin-top: 0.5rem;
}

/* ExternalId ボックス */
.ctg-external-id-box {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    padding: 0.875rem 1rem;
    border-radius: 6px;
    border: 2px solid #3b82f6;
    margin: 1rem 0;
}

.ctg-external-id-box code {
    flex: 1;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 1rem;
    color: #dc2626;
    background: none;
    padding: 0;
    font-weight: 600;
}

.ctg-copy-btn {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.ctg-copy-btn:hover {
    background: #1d4ed8;
}

.ctg-copy-btn.copied {
    background: #16a34a;
}

/* セキュリティ情報（折りたたみ） */
.ctg-security-info {
    background: #fefce8;
    border: 1px solid #fde047;
    border-radius: 6px;
    margin-top: 1rem;
}

.ctg-security-info summary {
    padding: 0.875rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: #854d0e;
    user-select: none;
}

.ctg-security-info summary:hover {
    background: #fef9c3;
}

.ctg-details-content {
    padding: 0 1rem 1rem 1rem;
    border-top: 1px solid #fde047;
}

.ctg-details-content ul {
    margin: 0.75rem 0;
    padding-left: 1.25rem;
}

.ctg-details-content li {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #713f12;
    line-height: 1.6;
}

.ctg-help-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.ctg-help-text a {
    color: #3b82f6;
    text-decoration: none;
}

.ctg-help-text a:hover {
    text-decoration: underline;
}

/* フォーム */
.ctg-form h4 {
    margin: 1.5rem 0 1rem 0;
    color: #1a1a2e;
    font-size: 1.1rem;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.ctg-form-group {
    margin-bottom: 1.5rem;
}

.ctg-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.ctg-form-group label .required {
    color: #dc3545;
}

.ctg-form-group input[type="text"],
.ctg-form-group input[type="email"],
.ctg-form-group select,
.ctg-form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.ctg-form-group input:focus,
.ctg-form-group select:focus,
.ctg-form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.ctg-form-group input:invalid {
    border-color: #dc3545;
}

.ctg-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.ctg-field-help {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ファイルアップロード */
.ctg-form-group input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed #ced4da;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
}

.ctg-form-group input[type="file"]:hover {
    border-color: #007bff;
    background: #e7f3ff;
}

/* 区切り線 */
.ctg-divider {
    border: none;
    border-top: 1px solid #e9ecef;
    margin: 2rem 0;
}

/* 送信ボタン */
.ctg-form-actions {
    text-align: center;
    margin-top: 2rem;
}

.ctg-submit-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ctg-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.ctg-submit-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ctg-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.ctg-btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ctg-spin 0.8s linear infinite;
}

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

/* 結果表示 */
.ctg-result {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 6px;
}

.ctg-result.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.ctg-result.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
}

.ctg-result h4 {
    margin: 0 0 0.5rem 0;
    border: none;
    padding: 0;
}

.ctg-result p {
    margin: 0.5rem 0;
}

.ctg-result .request-id {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .ctg-grading-form-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .ctg-external-id-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ctg-submit-btn {
        width: 100%;
        padding: 1rem;
    }
}
