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

body {
    overflow: hidden;
}

#url2at-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.login-bottom-links {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    width: 100%;
    max-width: 500px;
    margin-top: auto;
    padding: 0;
    background: none;
    border: none;
}

.login-bottom-links a {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}

.login-bottom-links a:hover {
    color: var(--text);
}

.main-content {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.app-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    flex-shrink: 0;
}

.app-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    height: 100%;
    padding: 40px;
    background: var(--bg-auth-side);
    position: relative;
    overflow: auto;
}

.app-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 550px;
    text-align: center;
    position: relative;
    z-index: 1;
    min-height: 0;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 24px 0 12px;
}

.app-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.85;
    font-weight: 300;
}

.features-list {
    text-align: left;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 16px;
    background: var(--feature-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--feature-border);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--feature-border);
    border-radius: var(--radius-md);
}

.feature-text h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

.auth-section {
    flex: 0 0 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-muted);
    overflow: auto;
}

.auth-sidebar {
    width: 100%;
    max-width: 400px;
    background: var(--bg-auth-panel);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-elevated);
    border: 1px solid var(--border);
}

.logo {
    text-align: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.logo p {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--input-bg);
    color: var(--text);
    font-family: var(--font-sans);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.forgot-password {
    text-align: right;
    margin-bottom: 20px;
}

.forgot-password a {
    color: var(--accent);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.btn {
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

a.btn {
    display: block;
    text-align: center;
    box-sizing: border-box;
}

a.btn:hover,
a.btn:focus,
a.btn:visited {
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-notion {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-notion:hover {
    border-color: var(--border-strong);
    background: var(--bg-elevated);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    margin-top: 8px;
}

.btn-secondary:hover {
    border-color: var(--border-strong);
    background: var(--bg-surface);
}

.auth-toggle {
    text-align: center;
    padding-top: 16px;
}

.auth-toggle p {
    font-size: 14px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.auth-toggle button,
.back-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.success-message {
    background: rgba(52, 199, 89, 0.12);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.error-message {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
}

.connect-section .hint {
    font-size: 13px;
    opacity: 0.75;
    margin: 12px 0;
}

.notion-status {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
}

.notion-status:not(.error) {
    background: var(--success-bg);
    border: 1px solid var(--success);
    color: var(--success);
}

.notion-status.error {
    background: var(--error-bg);
    border: 1px solid var(--error);
    color: var(--error);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    background: var(--bg-elevated);
    color: var(--text);
    padding: 32px 48px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--spinner-track);
    border-top-color: var(--spinner-active);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Single-column Notion-only login */
body.login-only {
    overflow: auto;
}

body.login-only #url2at-app {
    overflow: auto;
}

body.login-only .main-content {
    justify-content: center;
    align-items: center;
    overflow: auto;
}

body.login-only .login-auth-section {
    flex: none;
    width: 100%;
    max-width: 480px;
    background: transparent;
    padding: 24px;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.inline-error {
    background: rgba(254, 178, 178, 0.1);
    border-color: #742a2a;
    color: #fc8181;
}

@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .app-info-section {
        flex: 0 0 auto;
        padding: 24px;
    }

    .auth-section {
        flex: 1;
        flex-basis: auto;
    }

    .features-list {
        display: none;
    }

    .app-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 640px) {
    .login-bottom-links {
        gap: 6px 10px;
    }
}
