:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --bg-dark: #0F172A;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);
}

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

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

.background-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

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

.blob-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(79,70,229,0.8) 0%, rgba(79,70,229,0) 70%);
    animation-delay: 0s;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(16,185,129,0.5) 0%, rgba(16,185,129,0) 70%);
    animation-delay: -5s;
}

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

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 550px; /* Aumentado */
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

header h1 {
    font-size: 2.8rem; /* Aumentado */
    font-weight: 700;
    margin-bottom: 0.8rem;
    background: linear-gradient(to right, #ffffff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1.2rem; /* Aumentado */
    line-height: 1.5;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem 2.5rem; /* Aumentado */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.6);
}

.input-group {
    margin-bottom: 1.8rem;
}

label {
    display: block;
    font-size: 1.1rem; /* Aumentado */
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text-main);
}

input {
    width: 100%;
    padding: 1.2rem 1.2rem; /* Aumentado */
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: white;
    font-size: 1.2rem; /* Aumentado */
    font-family: inherit;
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.primary-btn {
    width: 100%;
    padding: 1.2rem; /* Aumentado */
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 1.3rem; /* Aumentado */
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.loader {
    width: 24px;
    height: 24px;
    border: 4px 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); }
}

.result-container {
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.qr-wrapper {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    display: inline-block;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.qr-wrapper img {
    width: 280px; /* Aumentado */
    height: 280px; /* Aumentado */
    display: block;
}

.status-message {
    color: var(--text-muted);
    font-size: 1.1rem; /* Aumentado */
    line-height: 1.4;
}

.success-indicator {
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-indicator p {
    font-weight: 600;
    font-size: 1.4rem; /* Aumentado */
}

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

.error-message {
    color: #ef4444;
    margin-top: 1.2rem;
    font-size: 1.1rem;
    text-align: center;
}

footer {
    text-align: center;
    margin-top: 2.5rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.pairing-code-display {
    font-size: 2.2rem;
    font-weight: bold;
    letter-spacing: 6px;
    color: var(--primary);
    margin: 20px 0;
    word-break: break-all;
}

/* Responsividade para Mobile */
@media screen and (max-width: 600px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    header p {
        font-size: 1rem;
    }

    .glass-card {
        padding: 2rem 1.2rem;
        border-radius: 16px;
    }

    label {
        font-size: 1rem;
    }

    input {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .primary-btn {
        padding: 1rem;
        font-size: 1.1rem;
    }

    .qr-wrapper img {
        width: 100%;
        max-width: 250px;
        height: auto;
    }

    .success-indicator p {
        font-size: 1.2rem;
    }

    footer {
        font-size: 0.95rem;
        margin-top: 1.5rem;
    }

    .pairing-code-display {
        font-size: 1.5rem;
        letter-spacing: 4px;
        margin: 15px 0;
    }
}
