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

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

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #e0e0e0;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(168,85,247,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    z-index: -1;
}

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

.container {
    width: 100%;
    max-width: 520px;
}

.card {
    background: rgba(30, 30, 40, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4),
                inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

p {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 15px;
    line-height: 1.6;
}

label {
    display: block;
    text-align: left;
    margin: 20px 0 8px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 14px;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 15px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

input[type="text"]:focus,
input[type="file"]:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

::file-selector-button {
    margin-right: 15px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.2);
    color: #d1a7ff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

::file-selector-button:hover {
    background: rgba(168, 85, 247, 0.3);
}

.preview-container {
    margin: 20px 0;
    text-align: center;
}

.preview-container img {
    max-width: 160px;
    height: 160px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.preview-container img:hover {
    transform: scale(1.05);
}

.btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
    margin-top: 10px;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
    background: linear-gradient(90deg, #c078ff, #5a98f6);
}

.btn:active {
    transform: translateY(1px);
}

.status, .success, .error {
    margin-top: 30px;
    padding: 24px;
    border-radius: 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.5s ease;
}

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

.status {
    border-left: 4px solid #3b82f6;
}

.success {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.error {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.hidden {
    display: none !important;
}

.pairing-code {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.pairing-code h4 {
    margin-bottom: 10px;
    color: #f59e0b;
    font-weight: 600;
    font-size: 16px;
}

#codeDisplay {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #fcd34d;
    text-shadow: 0 0 10px rgba(252, 211, 77, 0.5);
    font-family: 'Courier New', monospace;
}

/* Responsive */
@media (max-width: 600px) {
    .card {
        padding: 30px 20px;
        margin: 10px;
    }

    h1 {
        font-size: 24px;
    }

    .btn {
        font-size: 16px;
        padding: 14px;
    }

    #codeDisplay {
        font-size: 22px;
        letter-spacing: 4px;
    }
}