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

html, body {
    height: 100%;
}

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f4ede4;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    padding: 40px 40px 0;
    text-align: center;
}

.slack-logo {
    width: 32px;
    height: 32px;
}

/* Main Content */
.main-content {
    padding: 24px 40px 32px;
}

/* Title */
h1 {
    font-size: 28px;
    font-weight: 900;
    color: #1d1c1d;
    line-height: 1.2;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    font-size: 15px;
    font-weight: 400;
    color: #616061;
    line-height: 1.5;
    margin-bottom: 28px;
    text-align: center;
}

/* Steps */
.step {
    display: none;
    width: 100%;
}

.step.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

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

/* Input Field */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #1d1c1d;
    margin-bottom: 8px;
}

.input-container {
    position: relative;
}

.input-field {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-family: inherit;
    font-size: 18px;
    color: #1d1c1d;
    background: #fff;
    border: 1px solid #868686;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.input-field::placeholder {
    color: #868686;
}

.input-field:hover {
    border-color: #1d1c1d;
}

.input-field:focus {
    border-color: #1264a3;
    box-shadow: 0 0 0 4px rgba(18, 100, 163, 0.1);
}

/* Error State */
.input-container.error .input-field {
    border-color: #e01e5a;
    box-shadow: 0 0 0 4px rgba(224, 30, 90, 0.1);
}

.error-message {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: #e01e5a;
}

.error-message svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.error-message span {
    font-size: 13px;
    line-height: 1.4;
}

.input-container.error + .error-message {
    display: flex;
}

/* Buttons */
.btn {
    width: 100%;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, opacity 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    margin-bottom: 12px;
}

.btn:last-of-type {
    margin-bottom: 0;
}

.btn-primary {
    background: #611f69;
    color: #fff;
}

.btn-primary:hover {
    background: #4a154b;
}

.btn-secondary {
    background: #fff;
    color: #1d1c1d;
    border: 1px solid #868686;
}

.btn-secondary:hover {
    background: #f8f8f8;
    border-color: #1d1c1d;
}

.btn-google {
    background: #fff;
    color: #1d1c1d;
    border: 1px solid #868686;
}

.btn-google:hover {
    background: #f8f8f8;
    border-color: #1d1c1d;
}

.btn-apple {
    background: #1d1c1d;
    color: #fff;
}

.btn-apple:hover {
    background: #000;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.divider span {
    padding: 0 16px;
    font-size: 13px;
    color: #616061;
    font-weight: 700;
}

/* Terms */
.terms-text {
    font-size: 13px;
    color: #616061;
    text-align: center;
    margin-top: 24px;
    line-height: 1.5;
}

.terms-text a {
    color: #1264a3;
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    padding: 16px 40px;
    background: #f8f8f8;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 16px;
}

.footer-link {
    font-size: 13px;
    color: #616061;
    text-decoration: none;
}

.footer-link:hover {
    color: #1264a3;
    text-decoration: underline;
}

.lang-select {
    font-family: inherit;
    font-size: 13px;
    color: #616061;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
}

.lang-select:focus {
    outline: none;
}

/* Loading */
.loading-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
}

.slack-loader {
    width: 40px;
    height: 40px;
    position: relative;
    margin-bottom: 24px;
}

.dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 1.2s ease-in-out infinite;
}

.dot1 {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #36c5f0;
    animation-delay: 0s;
}

.dot2 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: #2eb67d;
    animation-delay: 0.3s;
}

.dot3 {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #ecb22e;
    animation-delay: 0.6s;
}

.dot4 {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: #e01e5a;
    animation-delay: 0.9s;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.7;
    }
}

.dot1 {
    animation: pulse1 1.2s ease-in-out infinite;
}
.dot2 {
    animation: pulse2 1.2s ease-in-out infinite;
}
.dot3 {
    animation: pulse3 1.2s ease-in-out infinite;
}
.dot4 {
    animation: pulse4 1.2s ease-in-out infinite;
}

@keyframes pulse1 {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.3); opacity: 0.7; }
}
@keyframes pulse2 {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.3); opacity: 0.7; }
}
@keyframes pulse3 {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 1; }
    50% { transform: translateX(-50%) scale(1.3); opacity: 0.7; }
}
@keyframes pulse4 {
    0%, 100% { transform: translateY(-50%) scale(1); opacity: 1; }
    50% { transform: translateY(-50%) scale(1.3); opacity: 0.7; }
}

.loading-text {
    font-size: 15px;
    color: #616061;
    text-align: center;
}

.loading-email {
    font-size: 15px;
    color: #1d1c1d;
    margin-top: 8px;
    font-weight: 700;
}

/* Error Screen */
.error-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fdf2f5;
    border: 1px solid #e01e5a;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-banner svg {
    width: 20px;
    height: 20px;
    color: #e01e5a;
    flex-shrink: 0;
}

.error-banner span {
    font-size: 15px;
    font-weight: 700;
    color: #e01e5a;
}

.account-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 20px;
}

.account-avatar {
    width: 36px;
    height: 36px;
    background: #611f69;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.account-avatar svg {
    width: 24px;
    height: 24px;
}

.account-card span {
    font-size: 15px;
    color: #1d1c1d;
    font-weight: 700;
}

.error-details {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.error-title {
    font-size: 15px;
    font-weight: 700;
    color: #1d1c1d;
    margin-bottom: 12px;
}

.error-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.error-list li {
    font-size: 14px;
    color: #616061;
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.error-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: #e01e5a;
}

.error-code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    background: #f8f8f8;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

.help-link {
    display: block;
    margin-top: 20px;
    font-size: 15px;
    color: #1264a3;
    text-decoration: none;
    text-align: center;
    font-weight: 700;
}

.help-link:hover {
    text-decoration: underline;
}
