:root {
    --snap-yellow: #FFFC00;
    --snap-yellow-dark: #F2EF00;
    --text-color: #000000;
    --accent-color: #000000;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-soft: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --input-bg: #F0F0F0;
    --input-focus: #FFFFFF;
    --transition-speed: 0.3s;
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--snap-yellow);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.4) 0%, transparent 20%);
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden; /* For background animations */
}

/* Dynamic Background Animation */
body::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 50%);
    animation: rotateBackground 20s linear infinite;
    z-index: -1;
}

@keyframes rotateBackground {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.container {
    position: relative;
    width: 320px;
    max-width: 90%;
    padding: 40px 30px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUpFade 0.8s var(--ease-elastic) forwards;
}

@keyframes slideUpFade {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.container h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-color);
    letter-spacing: 0.5px;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.2s forwards;
}

.logo img {
    width: 70px;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

form {
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.4s forwards;
}

form input {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 15px;
    border: 2px solid transparent;
    border-radius: 16px;
    background-color: var(--input-bg);
    font-size: 15px;
    font-weight: 500;
    color: #333;
    transition: all var(--transition-speed) ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

form input:focus {
    outline: none;
    background-color: var(--input-focus);
    border-color: var(--snap-yellow);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

form input::placeholder {
    color: #999;
}

form button {
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    border: none;
    border-radius: 16px;
    background-color: var(--accent-color); /* Black for Snapchat style */
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) var(--ease-elastic);
    position: relative;
    overflow: hidden;
}

form button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    background-color: #222;
}

form button:active {
    transform: translateY(-1px) scale(0.98);
}

/* Shine effect on button */
form button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

form button:hover::after {
    left: 100%;
}

.forgot-password {
    display: inline-block;
    margin-top: 20px;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.6s forwards;
}

.forgot-password:hover {
    color: var(--text-color);
}

.social-nav {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.05);
    width: 100%;
    opacity: 0;
    animation: fadeIn 0.5s ease 0.8s forwards;
}

.social-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.3s var(--ease-elastic);
}

.social-nav a:hover {
    transform: translateY(-5px) rotate(10deg);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.social-nav img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* Success Message */
.congrats-container {
    display: none;
    text-align: center;
    animation: popIn 0.5s var(--ease-elastic);
}

.congrats-container h2 {
    color: var(--accent-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.congrats-container p {
    color: #666;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- THEME SUPPORT (Optimized) --- */

/* Theme 1 */
body.theme-1 {
    background: #fafafa; /* Solid background for authentic look */
}

body.theme-1::before {
    display: none;
}

body.theme-1 .container {
    background: white;
    border: 1px solid #dbdbdb;
    box-shadow: none;
    border-radius: 1px;
    max-width: 350px;
}

body.theme-1 .logo img {
    width: 175px;
    animation: none;
    filter: none;
}

body.theme-1 button {
    background-color: #0095f6;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    margin-top: 8px;
    box-shadow: none;
}

body.theme-1 button:hover {
    background-color: #1877f2;
    transform: none;
    box-shadow: none;
}

body.theme-1 input {
    background: #fafafa;
    border: 1px solid #dbdbdb;
    border-radius: 3px;
    font-size: 12px;
    padding: 10px 8px;
    margin-bottom: 6px;
    box-shadow: none;
}

body.theme-1 input:focus {
    border: 1px solid #a8a8a8;
    transform: none;
    box-shadow: none;
}

/* Theme 2 */
body.theme-2 {
    background: #fff;
    font-family: 'Google Sans', 'Roboto', arial, sans-serif;
}

body.theme-2::before {
    display: none;
}

body.theme-2 .container {
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 48px 40px 36px;
    width: 450px;
    box-shadow: none;
    background: white;
}

body.theme-2 .logo img {
    width: 75px;
    animation: none;
    filter: none;
    margin-bottom: 10px;
}

body.theme-2 h1 {
    font-weight: 400;
    font-size: 24px;
    color: #202124;
    margin-bottom: 10px;
}

body.theme-2 button {
    background-color: #1a73e8;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 24px;
    width: auto;
    float: right;
    margin-top: 20px;
    box-shadow: none;
}

body.theme-2 button:hover {
    background-color: #287ae6;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3);
    transform: none;
}

body.theme-2 input {
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 13px 15px;
    margin-bottom: 20px;
    font-size: 16px;
    background: white;
    box-shadow: none;
}

body.theme-2 input:focus {
    border: 2px solid #1a73e8;
    padding: 12px 14px; /* Adjust for border width change */
    transform: none;
    box-shadow: none;
}

.version-text {
    font-size: 11px;
    color: rgba(0,0,0,0.4);
    margin-top: 20px;
    font-weight: 500;
}
