:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #10b981;
    --bg-gradient-start: #f3f4f6;
    --bg-gradient-end: #e5e7eb;
    --card-bg: #ffffff;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --input-bg: #f9fafb;
    --error: #ef4444;
    --success: #10b981;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-main);
    overflow-x: hidden;
}

body.centered {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.animated-bg li {
    position: absolute;
    display: block;
    list-style: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    animation: animate 25s linear infinite;
    bottom: -150px;
}

.animated-bg li:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.animated-bg li:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.animated-bg li:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.animated-bg li:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.animated-bg li:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.animated-bg li:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.animated-bg li:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.animated-bg li:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.animated-bg li:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.animated-bg li:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }

@keyframes animate {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; border-radius: 0; }
    100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; border-radius: 50%; }
}

/* Auth Card */
.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin: auto;
}

.auth-card.wide {
    max-width: 900px;
}

@keyframes slideUp {
    to { transform: translateY(0); opacity: 1; }
}

.auth-header {
    padding: 40px 30px 20px;
    text-align: center;
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: var(--primary);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    font-size: 28px;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.auth-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 16px;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-body {
    padding: 20px 30px 40px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    color: var(--text-main);
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 38px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
    color: white;
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Links */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: shake 0.5s ease-in-out;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
    margin-top: 5px;
}

.alert-error, .alert-danger {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #d1fae5;
    color: #065f46;
    animation: slideDown 0.5s ease-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

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

/* Tenant Badge */
.tenant-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 12px;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo img { height: 40px; width: auto; }

.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--primary); }

.nav-buttons { display: flex; gap: 15px; }
.nav-buttons .btn { width: auto; padding: 10px 24px; }

/* Register Page */
.register-container {
    padding: 120px 5% 80px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
    color: white;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.form-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    animation: slideUp 0.6s ease-out forwards;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i { color: var(--primary); }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Plan Selection */
.plan-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    background: var(--input-bg);
}

.plan-card:hover {
    transform: translateY(-5px);
    border-color: #a5b4fc;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.plan-card.selected {
    border-color: var(--primary);
    background: #eef2ff;
    box-shadow: 0 0 0 2px var(--primary);
}

.plan-card.popular::before {
    content: 'Popular';
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--secondary);
    color: white;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.plan-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; }
.plan-price { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 15px; }
.plan-period { font-size: 0.85rem; color: var(--text-muted); font-weight: 400; }
.plan-features { font-size: 0.9rem; color: var(--text-muted); list-style: none; }
.plan-features li { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.plan-features i { color: var(--secondary); font-size: 0.9rem; }

/* Helpers */
.text-muted { color: var(--text-muted); font-size: 0.85rem; margin-top: 5px; display: block; }
.text-danger { color: var(--error); }
.text-success { color: var(--success); }

.subdomain-preview {
    font-family: monospace;
    background: var(--border-color);
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 5px;
    font-size: 0.9rem;
    display: inline-block;
    color: var(--text-main);
}

.password-strength {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.strength-bar { height: 100%; width: 0; transition: all 0.3s; }

.checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
}
.checkbox-wrapper input {
    margin-top: 4px;
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}
.checkbox-wrapper label { cursor: pointer; font-size: 0.95rem; line-height: 1.5; }

/* Footer */
footer {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 60px 5% 30px;
    margin-top: auto;
    width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: #9ca3af; text-decoration: none; transition: color 0.3s; }
.footer-links a:hover { color: white; }
.contact-info li { display: flex; align-items: center; gap: 10px; color: #9ca3af; margin-bottom: 15px; }

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

.mobile-menu {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: white;
    padding: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-150%);
    transition: transform 0.3s ease-in-out;
    z-index: 999;
}
.mobile-menu.active { transform: translateY(0); }
.mobile-nav-links { display: flex; flex-direction: column; gap: 15px; }
.mobile-nav-links a { text-decoration: none; color: var(--text-main); font-weight: 500; padding: 10px; border-bottom: 1px solid var(--border-color); }

/* Responsive adjustments */
@media (max-width: 768px) {
    .navbar { padding: 1rem; }
    .nav-links, .nav-buttons { display: none; }
    .mobile-menu-btn { display: block; }
    .register-container { padding-top: 100px; padding-left: 20px; padding-right: 20px; }
    .grid-2 { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
    body { padding: 0; }
    body.centered { padding: 20px; }
    .auth-card { margin: 0; border-radius: 0; min-height: 100vh; }
}
