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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    color: #000;
    font-size: 16px;
    line-height: 1.5;
}

.container {
    width: 100%;
    max-width: 480px;
    position: relative;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-modal {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
}

.auth-modal h2 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.auth-modal p {
    color: #666;
    margin-bottom: 24px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 32px;
}

header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #000;
    letter-spacing: -0.5px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
}

.github-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.subtitle {
    font-size: 18px;
    color: #666;
    font-weight: 400;
}

/* Form */
.workflow-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.field-header label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.optional {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* Input fields */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}

.searchable-select-input,
.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s;
    font-family: inherit;
    color: #000;
    position: relative;
    z-index: 2;
}

.searchable-select-input:focus,
.form-input:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 1px #6b7280;
}

.searchable-select-input::placeholder {
    color: #9ca3af;
}

.searchable-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 0;
    pointer-events: none;
}

.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 150px;
    overflow-y: auto;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.searchable-select-dropdown.show {
    display: block;
}

.searchable-select-option {
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.searchable-select-option:hover {
    background: #f5f5f5;
}

.searchable-select-option.selected {
    background: #f0f0f0;
}

.searchable-select-option.hidden {
    display: none;
}

/* Select fields */
.form-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
    font-family: inherit;
    color: #000;
}

.form-select:focus {
    outline: none;
    border-color: #6b7280;
    box-shadow: 0 0 0 1px #6b7280;
}

/* Checkbox */
.checkbox-wrapper {
    padding: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    font-size: 16px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Button */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
    font-family: inherit;
    background: #f9fafb;
    color: #000;
}

.btn-primary {
    width: 100%;
}

/* Green color when button is active (can run workflow) */
.btn-primary.btn-active {
    background: #10b981;
    color: white;
    border-color: #059669;
}

.btn-primary.btn-active:hover:not(:disabled) {
    background: #059669;
    border-color: #047857;
}

.btn-primary:not(.btn-active):hover:not(:disabled) {
    background: #f3f4f6;
}

.btn-primary:active:not(:disabled) {
    background: #047857;
    color: white;
    border-color: #065f46;
}

.btn-primary:disabled {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
    opacity: 0.5 !important;
    pointer-events: none !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: #f9fafb;
    border-color: #6b7280;  /* Темнее обводка */
    color: #374151;  /* Темнее текст */
}

.btn-secondary:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #4b5563;
    color: #1f2937;
}

.btn-secondary:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

/* General disabled button styles */
.btn:disabled {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
    background: #f3f4f6;
    color: #9ca3af;
}

/* Result page styles */
.result {
    text-align: center;
    padding: 40px 32px;
    border-radius: 8px;
    margin-top: 0;
    border: 1px solid #d1d5db;
}

.result.success {
    background: white;
    border-color: #d1d5db;
}

.result.error {
    background: white;
    border-color: #d1d5db;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 20px;
    font-weight: 600;
    line-height: 1;
}

.result.success .result-icon {
    color: #000;
}

.result.error .result-icon {
    color: #666;
}

.result h2 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #000;
}

.result-message {
    font-size: 16px;
    margin-bottom: 24px;
    color: #666;
    line-height: 1.5;
}

.workflow-info {
    background: #f9fafb;
    padding: 20px;
    border-radius: 6px;
    margin: 24px 0;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.info-item {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-item strong {
    font-weight: 500;
    color: #374151;
    min-width: 100px;
    flex-shrink: 0;
    font-size: 14px;
}

.info-item a {
    color: #000;
    text-decoration: underline;
    text-decoration-color: #9ca3af;
    font-size: 14px;
}

.info-item a:hover {
    text-decoration-color: #000;
}

.action-links {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.action-links .btn {
    width: auto;
    min-width: 120px;
}

/* Workflow inputs wrapper */
#workflow-inputs-wrapper {
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    margin-top: 6px;
}

#workflow-inputs-wrapper:empty {
    display: none;
}

#workflow-inputs {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Loading and error states */
.loading-state {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    color: #999;
    font-size: 14px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Field with loader */
.field-with-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 34px;
}

.field-with-loader .searchable-select-wrapper {
    flex: 1;
}

.field-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.error-state {
    padding: 12px;
    color: #666;
    font-size: 14px;
    background: #fff5f5;
    border: 1px solid #ffcccc;
    border-radius: 4px;
    min-height: 20px;
    box-sizing: border-box;
}

/* Footer */
.page-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.user-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.user-login {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.btn-small {
    padding: 6px 16px;
    font-size: 13px;
}

/* Permission message */
#permission-message {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 8px;
}

#permission-message:not(:empty) {
    background: #fff5f5;  /* Нежно-розовый фон */
    border: 1px solid #fce7e7;  /* Мягкая розовая граница */
    color: #6b7280;  /* Серый текст */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);  /* Легкая тень для глубины */
}

/* Responsive */
@media (max-width: 640px) {
    body {
        padding: 20px;
    }

    header h1 {
        font-size: 36px;
    }

    .github-logo {
        width: 64px;
        height: 64px;
    }
}
