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

:root {
    --navy-blue: #122742;
    --dark-navy: #0d1a2f;
    --gold: #d4af37;
    --light-gold: #f0d97d;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --text-dark: #333333;
    --text-light: #666666;
    --error-red: #ef4444;
    --success-green: #10b981;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: url('https://slotliman4.com/static/media/bg.b0108065.jpg') center center / cover no-repeat fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, rgba(26, 35, 50, 0.9) 0%, rgba(15, 22, 33, 0.95) 100%);
    backdrop-filter: blur(10px);
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    z-index: 1;
}

.form-card {
    background: #122742;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 100px rgba(212, 175, 55, 0.1);
    padding: 50px 40px;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    border: 3px solid rgba(212, 175, 55, 0.2);
}

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

.logo-container {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 180px;
    height: auto;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    color: var(--white);
    background: #122742;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

.form-group input:focus {
    border-color: var(--gold);
    background: #122742;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
    transform: translateY(-2px);
}

.form-group input:valid {
    border-color: var(--success-green);
}

.form-group input.error {
    border-color: var(--error-red);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.password-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 16px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.3s ease;
    user-select: none;
}

.toggle-password:hover {
    color: var(--gold);
}

.eye-icon {
    display: block;
}

.error-message {
    color: var(--error-red);
    font-size: 12px;
    margin-top: 6px;
    margin-left: 4px;
    font-weight: 500;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.error-message.show {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--light-gold) 100%);
    color: var(--navy-blue);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

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

.btn-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid var(--navy-blue);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .spinner {
    display: block;
}

.success-message {
    display: none;
    text-align: center;
    animation: scaleIn 0.5s ease-out;
}

.success-message.show {
    display: block;
}

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

.register-form.hide {
    display: none;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--success-green) 0%, #059669 100%);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
    animation: checkmark 0.6s ease-out;
}

.success-icon svg {
    stroke: white;
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.success-message h2 {
    color: var(--gold);
    font-size: 28px;
    margin-bottom: 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#successSubtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.username-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 30px;
}

.username-text {
    font-size: 42px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 4px;
    font-family: 'Poppins', sans-serif;
}

.copy-btn {
    background: transparent;
    border: 2px solid var(--gold);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn svg {
    stroke: var(--gold);
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.05);
}

.copy-btn.copied {
    background: var(--success-green);
    border-color: var(--success-green);
}

.copy-btn.copied svg {
    stroke: white;
}

.login-btn {
    display: block;
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #d4a033 0%, #c9952e 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(212, 160, 51, 0.4);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(212, 160, 51, 0.5);
    background: linear-gradient(135deg, #e0b040 0%, #d4a033 100%);
}

.success-message p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
}

.api-response {
    margin-top: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-align: left;
}

.api-response-title {
    color: var(--gold);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.api-response-content {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

.api-response-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.api-response-item:last-child {
    border-bottom: none;
}

.api-response-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.api-response-value {
    color: var(--gold);
    font-size: 13px;
    font-weight: 500;
}

.api-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 12px;
}

.api-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-green);
}

.api-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-red);
}

@media (max-width: 576px) {
    .form-card {
        padding: 40px 30px;
        border-radius: 16px;
    }

    .logo {
        width: 150px;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 14px;
    }

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

    .success-icon {
        width: 80px;
        height: 80px;
    }

    .success-icon svg {
        width: 45px;
        height: 45px;
    }

    .success-message h2 {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .success-message p {
        font-size: 14px;
    }

    #successSubtitle {
        font-size: 12px;
        letter-spacing: 1px;
    }

    .username-box {
        padding: 16px 20px;
        gap: 12px;
    }

    .username-text {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .copy-btn {
        padding: 10px;
    }

    .copy-btn svg {
        width: 20px;
        height: 20px;
    }

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

@media (max-width: 400px) {
    body {
        padding: 15px;
    }

    .form-card {
        padding: 30px 20px;
    }

    .logo {
        width: 130px;
    }
}

@media (min-width: 768px) {
    .form-card {
        padding: 60px 50px;
    }

    .logo {
        width: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
