@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg: #0A0A0A;
    --surface: #141414;
    --border: #2a2a2a;
    --text-primary: #EAEAEA;
    --text-secondary: #888888;
    --accent-blue: #33A3FF;
    --accent-cyan: #00E5FF;
    --success: #00C853;
    --error: #FF4D4D;
    
    --font-mono: 'IBM Plex Mono', monospace;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;

    --shadow-glow: 0 0 25px 0px rgba(0, 229, 255, 0.15);
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-mono);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    padding: 2rem 1rem;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Card */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #3a3a3a;
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    min-height: 2.4rem; /* Reserve space for text */
}

.info-text {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.info-text strong {
    color: var(--accent-blue);
    font-weight: 500;
}

/* Form */
.input-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input[type="text"] {
    width: 100%;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 2px solid var(--border);
    border-radius: 0;
    font-size: 1.25rem;
    transition: all 0.2s;
    font-family: var(--font-mono);
    background: transparent;
    color: var(--text-primary);
}

input[type="text"]:focus {
    outline: none;
    border-bottom-color: var(--accent-blue);
    box-shadow: none;
}

input[type="text"].error {
    border-color: var(--error);
}

input[type="text"].success {
    border-color: var(--success);
}

.input-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.validation-message {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.25rem;
}

.validation-message.error {
    color: var(--error);
}

.validation-message.success {
    color: var(--success);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: #0A0A0A;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: var(--border);
    box-shadow: none;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--surface);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

/* Progress */
.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.card.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { box-shadow: 0 0 15px rgba(0, 229, 255, 0.2); }
    50% { box-shadow: 0 0 25px rgba(0, 229, 255, 0.5); }
    100% { box-shadow: 0 0 15px rgba(0, 229, 255, 0.2); }
}

.progress-info {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.progress-info p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

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

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-percent {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 3rem;
    text-align: right;
    font-size: 0.9rem;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 8px;
    transition: all 0.3s;
}

.step.active {
    background: rgba(102, 126, 234, 0.1);
    border-left: 3px solid var(--primary);
}

.step-icon {
    font-size: 1.5rem;
}

.step-text {
    flex: 1;
    font-size: 0.95rem;
}

.progress-log {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    max-height: 200px;
    overflow-y: auto;
}

.progress-log .log-entry {
    animation: fadeInUp 0.5s ease;
}

.progress-log:empty {
    display: none;
}

/* Success */
.success-card {
    text-align: center;
}

.success-icon {
    margin-bottom: 1.5rem;
    animation: scaleIn 0.5s ease;
    font-size: 3rem;
    color: var(--success);
    border: 2px solid var(--success);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.success-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.success-details {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
    text-align: left;
    border: 1px solid var(--border);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

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

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.detail-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    font-family: var(--font-mono);
}

.detail-link:hover {
    text-decoration: underline;
}

.success-actions .btn-primary {
    animation: pulse 2s infinite;
}

/* Error */
.error-card {
    text-align: center;
}

.error-icon {
    margin-bottom: 1.5rem;
    animation: shake 0.5s ease;
    font-size: 3rem;
    color: var(--error);
    border: 2px solid var(--error);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.error-message {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 77, 77, 0.05);
    border: 1px solid rgba(255, 77, 77, 0.2);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: auto;
    padding: 2rem 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }
}

@keyframes blink {
    50% { opacity: 0; }
}
.typing-cursor {
    display: inline-block;
    width: 10px;
    height: 1.5rem;
    background-color: var(--accent-cyan);
    margin-left: 4px;
    animation: blink 1s steps(1) infinite;
    transform: translateY(4px);
}

.language-selector {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1000;
}

.lang-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lang-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
    transform: scale(1.05);
}

.lang-btn.active {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
}

[dir="rtl"] .typing-cursor {
    margin-left: 0;
    margin-right: 4px;
}

[dir="rtl"] .detail-item {
    flex-direction: row-reverse;
}

[dir="rtl"] .btn svg {
    transform: scaleX(-1);
}

[dir="rtl"] .language-selector {
    right: auto;
    left: 1rem;
}
