/* Base styles */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --success-color: #10b981;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-gray: #f9fafb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-gray);
    margin: 0;
    padding: 2rem 1rem;
}

.container {
    max-width: 48rem;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Form Container */
.form-container {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

label i {
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

/* Inputs */
input[type="url"],
input[type="password"],
textarea {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: all 0.2s;
}

input[type="url"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    ring: 2px solid var(--primary-color);
    border-color: var(--primary-color);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

/* Buttons */
.auth-button {
    display: flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: var(--bg-gray);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.auth-button.authorized {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.auth-button i {
    margin-right: 0.375rem;
    font-size: 0.75rem;
}

.submit-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-button:hover {
    background: var(--primary-hover);
}

.submit-button:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    width: 100%;
    max-width: 28rem;
    margin: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header i {
    margin-right: 0.5rem;
    color: var(--text-secondary);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.modal-body {
    padding: 1rem;
}

/* Info Box */
.info-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
}

.info-icon {
    color: var(--primary-color);
    margin-right: 0.5rem;
    margin-top: 0.125rem;
}

.info-content h4 {
    margin: 0;
    color: #1e40af;
    font-size: 0.875rem;
    font-weight: 500;
}

.info-content p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #1e40af;
}

.info-content a {
    color: #1e40af;
    text-decoration: underline;
}

/* Button Group */
.button-group {
    display: flex;
    gap: 0.75rem;
}

.primary-button,
.danger-button,
.secondary-button {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.primary-button {
    background: var(--primary-color);
    color: white;
    border: none;
    flex: 1;
}

.primary-button:hover {
    background: var(--primary-hover);
}

.danger-button {
    background: var(--danger-color);
    color: white;
    border: none;
}

.danger-button:hover {
    background: var(--danger-hover);
}

.secondary-button {
    background: var(--bg-gray);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.secondary-button:hover {
    background: #e5e7eb;
}

/* Results & Error */
.results,
.error {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.results pre {
    background: var(--bg-gray);
    padding: 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Utilities */
.hidden {
    display: none !important;
}

.loader {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid white;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: rotation 1s linear infinite;
    margin-left: 0.5rem;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}