@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    display: flex; justify-content: center; align-items: center;
    color: #ffffff; position: relative; overflow-x: hidden;
}

.animated-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.gradient-orb {
    position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.orb1 { width: 600px; height: 600px; background: #f6851b; top: -200px; left: -200px; animation-delay: 0s; }
.orb2 { width: 500px; height: 500px; background: #cd6116; bottom: -150px; right: -150px; animation-delay: 7s; }
.orb3 { width: 400px; height: 400px; background: #e2761b; top: 40%; left: 60%; animation-delay: 14s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(100px, -100px) scale(1.1); }
    50% { transform: translate(-50px, 100px) scale(0.9); }
    75% { transform: translate(150px, 50px) scale(1.05); }
}

.particle {
    position: absolute; width: 3px; height: 3px; background: rgba(246, 133, 27, 0.6);
    border-radius: 50%; animation: particleFloat 15s infinite ease-in-out;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
}

.container {
    background: rgba(255, 255, 255, 0.03); backdrop-filter: blur(30px);
    border-radius: 32px; box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 100px rgba(246, 133, 27, 0.1);
    width: min(480px, 95vw); padding: 3rem 2.5rem; text-align: center;
    position: relative; z-index: 1; animation: slideUp 0.8s cubic-bezier(0.25,0.46,0.45,0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp { from { opacity: 0; transform: translateY(40px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

.logo { 
    width: 88px; height: 88px; margin: 0 auto 2rem;
    border-radius: 24px; padding: 14px;
    background: rgba(246, 133, 27, 0.15);
    box-shadow: 0 16px 40px rgba(246, 133, 27, 0.3);
    display: block; object-fit: contain; border: 1px solid rgba(246, 133, 27, 0.3);
    animation: logoGlow 3s infinite ease-in-out;
}

@keyframes logoGlow {
    0%, 100% { box-shadow: 0 16px 40px rgba(246, 133, 27, 0.3); }
    50% { box-shadow: 0 16px 60px rgba(246, 133, 27, 0.6); }
}

h1 { 
    font-size: clamp(1.75rem, 5vw, 2.25rem); font-weight: 700; margin: 0 0 1rem;
    background: linear-gradient(135deg, #f6851b, #e2761b, #cd6116);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; animation: gradientShift 3s infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    color: #b0b0b0; font-size: 1.05rem; font-weight: 400; margin: 0 0 2.5rem; line-height: 1.6;
}

.word-selector {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    background: rgba(246, 133, 27, 0.1); border-radius: 16px; padding: 0.75rem 1.25rem;
    margin-bottom: 2rem; font-weight: 500; color: #f6851b;
    border: 1px solid rgba(246, 133, 27, 0.2);
    transition: all 0.3s;
}

.word-selector:hover { background: rgba(246, 133, 27, 0.15); border-color: rgba(246, 133, 27, 0.4); }

select {
    background: rgba(26, 26, 46, 0.8); border: 2px solid rgba(246, 133, 27, 0.3); 
    border-radius: 12px; padding: 0.75rem 1rem; font-size: 1rem; font-weight: 500; 
    color: #f6851b; cursor: pointer; transition: all 0.3s ease;
}

select:focus { outline: none; border-color: #f6851b; box-shadow: 0 0 0 3px rgba(246, 133, 27, 0.2); }
select:hover { border-color: #f6851b; }

.paste-section {
    background: rgba(246, 133, 27, 0.1); border-radius: 16px; padding: 1rem;
    margin-bottom: 1.5rem; border: 1px solid rgba(246, 133, 27, 0.2);
}

.paste-btn {
    background: linear-gradient(135deg, #f6851b 0%, #cd6116 100%);
    border: none; border-radius: 12px; color: white; font-weight: 600;
    padding: 0.75rem 1.5rem; cursor: pointer; transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(246, 133, 27, 0.3);
    font-size: 0.95rem;
}

.paste-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(246, 133, 27, 0.5); }

.phrase-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 1rem; margin-bottom: 2.5rem;
}

.phrase-input {
    position: relative; animation: fadeIn 0.5s ease-out backwards;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.phrase-input label {
    display: block; font-size: 0.75rem; font-weight: 600; color: #808080;
    margin-bottom: 0.5rem; text-align: center;
}

.phrase-input input {
    width: 100%; font-size: 1rem; padding: 0.875rem 1rem; text-align: center;
    border: 2px solid rgba(255, 255, 255, 0.1); border-radius: 12px; font-weight: 500;
    background: rgba(26, 26, 46, 0.5); color: #ffffff; transition: all 0.3s ease;
}

.phrase-input input:focus {
    border-color: #f6851b; box-shadow: 0 0 0 3px rgba(246, 133, 27, 0.2); outline: none;
    transform: translateY(-2px); background: rgba(26, 26, 46, 0.8);
}

.phrase-input input.valid { 
    border-color: #10b981; background: rgba(16, 185, 129, 0.1);
    animation: successPulse 0.5s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.phrase-input input.error { 
    border-color: #ef4444; background: rgba(239, 68, 68, 0.1); 
    animation: shake 0.5s;
}

.phrase-input input.duplicate { 
    border-color: #f59e0b; background: rgba(245, 158, 11, 0.1);
    animation: shake 0.5s;
}

@keyframes shake { 
    0%, 100% { transform: translateX(0); } 
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.hcaptcha-container {
    margin: 1.5rem 0 2rem 0;
    animation: fadeIn 0.8s ease-out 0.6s backwards;
}

.submit-btn {
    width: 100%; background: linear-gradient(135deg, #f6851b 0%, #cd6116 100%);
    border: none; border-radius: 16px; color: white; font-weight: 600; font-size: 1.125rem;
    padding: 1.125rem 2rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 12px 30px rgba(246, 133, 27, 0.4); position: relative; overflow: hidden;
}

.submit-btn::before {
    content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0;
    border-radius: 50%; background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%); transition: width 0.6s, height 0.6s;
}

.submit-btn:hover:not(:disabled)::before { width: 300px; height: 300px; }

.submit-btn:hover:not(:disabled) { 
    transform: translateY(-3px); box-shadow: 0 20px 40px rgba(246, 133, 27, 0.6);
}

.submit-btn:active:not(:disabled) { transform: translateY(-1px); }

.submit-btn:disabled { 
    background: rgba(80, 80, 80, 0.3); color: #808080; cursor: not-allowed; transform: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.security-hint {
    background: rgba(246, 133, 27, 0.1);
    border-radius: 12px; padding: 1rem; margin-top: 1.5rem; 
    border-left: 4px solid #f6851b; font-size: 0.875rem; color: #d0d0d0; font-weight: 500;
    animation: fadeIn 0.8s ease-out 0.8s backwards;
}

.floating-security { 
    position: absolute; top: 20px; right: 20px; font-size: 0.7rem; 
    color: rgba(246, 133, 27, 0.9); font-weight: 500; 
    background: rgba(246, 133, 27, 0.1); padding: 0.25rem 0.75rem; 
    border-radius: 20px; backdrop-filter: blur(10px);
    border: 1px solid rgba(246, 133, 27, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@media (max-width: 480px) {
    .phrase-grid { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
    .container { margin: 1rem; padding: 2rem 1.5rem; }
}