:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Background Animations */
.background-blobs {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.5;
    border-radius: 50%;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: #ec4899;
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Main Container (Glassmorphism) */
.container {
    position: relative;
    z-index: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    font-size: 14px;
    color: var(--text-muted);
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.input-group label {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="url"], input[type="text"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

input[type="url"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

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

/* Loading Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

.loading .btn-text { display: none; }
.loading .spinner { display: block; }
.loading { pointer-events: none; opacity: 0.8; }

/* Result Box */
.result-box {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.5s ease;
}

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

.result-box.hidden {
    display: none;
}

.result-box label {
    display: block;
    font-size: 14px;
    color: var(--success);
    margin-bottom: 8px;
    font-weight: 500;
}

.result-content {
    display: flex;
    gap: 10px;
}

.result-content input {
    flex: 1;
    color: #a5b4fc;
}

.btn-icon {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(99, 102, 241, 0.2);
    color: white;
}

.success-message {
    font-size: 13px;
    color: var(--success);
    margin-top: 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.success-message.show {
    opacity: 1;
}

.error-message {
    color: var(--error);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
}

.error-message.hidden {
    display: none;
}

/* Auth Styles */
.header-action {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.btn-text-small {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s;
}

.btn-text-small:hover {
    color: #a5b4fc;
}

#loginSection {
    animation: fadeIn 0.3s ease;
}

#converterSection {
    animation: fadeIn 0.3s ease;
}

#converterSection.hidden,
#loginSection.hidden {
    display: none;
}
