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

html, body {
    height: 100%;
}

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

.container {
    background: #fff;
    width: 100%;
    max-width: 440px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

@media (min-height: 500px) {
    .container {
        min-height: auto;
        border-radius: 4px;
    }
}

.main-content {
    flex: 1;
    padding: 44px 44px 20px;
    display: flex;
    flex-direction: column;
}

/* Microsoft Logo */
.microsoft-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.microsoft-logo {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

.microsoft-text {
    font-size: 15px;
    font-weight: 600;
    color: #1b1b1b;
    letter-spacing: -0.2px;
}

/* Title */
h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1b1b1b;
    line-height: 1.25;
    margin-bottom: 12px;
}

.subtitle {
    font-size: 15px;
    font-weight: 400;
    color: #1b1b1b;
    line-height: 1.4;
    margin-bottom: 24px;
}

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

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

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

/* Input Field - Microsoft Style */
.input-container {
    position: relative;
    margin-bottom: 4px;
}

.input-field {
    width: 100%;
    height: 36px;
    padding: 6px 12px 6px 0;
    font-family: inherit;
    font-size: 15px;
    color: #1b1b1b;
    background: transparent;
    border: none;
    border-bottom: 1px solid #8a8886;
    outline: none;
    transition: border-color 0.1s;
}

.input-field::placeholder {
    color: transparent;
}

.input-field:hover {
    border-bottom-color: #323130;
}

.input-field:focus {
    border-bottom-color: #0067b8;
    border-bottom-width: 2px;
    padding-bottom: 5px;
}

.input-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #8a8886;
    pointer-events: none;
    transition: all 0.15s ease-out;
}

.input-field:focus + .input-label,
.input-field.has-value + .input-label {
    top: -6px;
    font-size: 12px;
    color: #0067b8;
}

.input-field:not(:focus).has-value + .input-label {
    color: #605e5c;
}

/* Error State */
.input-container.error .input-field {
    border-bottom-color: #a4262c;
    border-bottom-width: 2px;
    padding-bottom: 5px;
}

.input-container.error .input-label {
    color: #a4262c;
}

.error-message {
    display: none;
    margin-top: 4px;
    padding-left: 0;
}

.error-message span {
    font-size: 12px;
    color: #a4262c;
    line-height: 1.4;
}

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

/* Helper text */
.helper-text {
    font-size: 13px;
    color: #1b1b1b;
    margin-top: 16px;
    line-height: 1.4;
}

.helper-text a {
    color: #0067b8;
    text-decoration: none;
}

.helper-text a:hover {
    text-decoration: underline;
    color: #005a9e;
}

/* Buttons */
.button-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 40px;
}

.btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    border-radius: 2px;
    transition: background-color 0.1s, border-color 0.1s;
    min-width: 108px;
    padding: 6px 12px;
    height: 32px;
}

.btn-primary {
    background: #0067b8;
    color: #fff;
}

.btn-primary:hover {
    background: #005a9e;
}

.btn-primary:active {
    background: #004578;
}

.btn-secondary {
    background: #fff;
    color: #1b1b1b;
    border: 1px solid #8a8886;
}

.btn-secondary:hover {
    background: #f3f2f1;
    border-color: #323130;
}

.btn-secondary:active {
    background: #edebe9;
}

/* Sign-in options */
.sign-in-options {
    margin-top: 20px;
    padding-top: 20px;
}

.options-title {
    font-size: 13px;
    color: #0067b8;
    cursor: pointer;
}

.options-title:hover {
    text-decoration: underline;
    color: #005a9e;
}

/* Footer */
.footer {
    padding: 16px 44px;
    background: #f5f5f5;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

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

.footer-separator {
    color: #616161;
    font-size: 12px;
}

.lang-select {
    font-family: inherit;
    font-size: 12px;
    color: #616161;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    margin-left: auto;
}

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

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

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f2f1;
    border-top-color: #0067b8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

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

.loading-email {
    font-size: 14px;
    color: #1b1b1b;
    margin-top: 8px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 2px;
    background: #edebe9;
    border-radius: 1px;
    overflow: hidden;
    margin-top: 24px;
}

.progress-fill {
    height: 100%;
    background: #0067b8;
    width: 0%;
    animation: progress 2.5s ease-in-out forwards;
}

@keyframes progress {
    0% { width: 0%; }
    30% { width: 40%; }
    60% { width: 70%; }
    90% { width: 90%; }
    100% { width: 95%; }
}

/* Error Screen */
.error-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
}

.error-icon svg {
    width: 100%;
    height: 100%;
}

.error-heading {
    color: #1b1b1b;
    margin-bottom: 16px;
}

.account-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 20px;
}

.account-avatar {
    width: 32px;
    height: 32px;
    background: #0067b8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.account-info span {
    font-size: 14px;
    color: #1b1b1b;
}

.error-details {
    background: #fdf6f6;
    border-left: 4px solid #d13438;
    padding: 16px;
    margin-bottom: 24px;
    border-radius: 0 4px 4px 0;
}

.error-title {
    font-size: 14px;
    font-weight: 600;
    color: #a4262c;
    margin-bottom: 12px;
}

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

.error-list li {
    font-size: 13px;
    color: #605e5c;
    padding: 4px 0;
    padding-left: 16px;
    position: relative;
}

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

.error-code {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 12px;
    background: #edebe9;
    padding: 2px 6px;
    border-radius: 2px;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.help-link {
    display: block;
    margin-top: 20px;
    font-size: 13px;
    color: #0067b8;
    text-decoration: none;
    text-align: center;
}

.help-link:hover {
    text-decoration: underline;
    color: #005a9e;
}

/* Teams branding hint */
.teams-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f2f1;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.teams-badge svg {
    width: 16px;
    height: 16px;
}

.teams-badge span {
    font-size: 12px;
    color: #605e5c;
}
