/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Google Sans', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4286;
    color: #202124;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* State Selector (for demo) */
.state-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

.state-selector select {
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

/* Container */
.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px 36px;
}

/* Sign-in Card */
.signin-card {
    width: 100%;
    max-width: 448px;
    min-height: 500px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 48px 40px 36px;
    background: #fff;
    box-shadow: none;
}

/* Google Logo */
.google-logo {
    text-align: center;
    margin-bottom: 24px;
}

/* Headings */
.signin-heading {
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3333;
    color: #202124;
    text-align: center;
    margin-bottom: 8px;
}

.signin-subheading {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 0.1px;
    line-height: 1.5;
    text-align: center;
    color: #202124;
    margin-bottom: 32px;
}

/* Account Chip (Password State) */
.account-chip {
    display: flex;
    justify-content: center;
    margin: 16px 0 40px;
}

.chip-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 4px 4px;
    border: 1px solid #dadce0;
    border-radius: 16px;
    background-color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.chip-content:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.account-icon {
    width: 20px;
    height: 20px;
}

.chip-content .user-email {
    font-size: 14px;
    color: #3c4043;
    font-weight: 500;
    letter-spacing: 0.25px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
}

.dropdown-icon {
    width: 18px;
    height: 18px;
}

/* Form Elements */
.signin-form {
    margin-top: 24px;
}

/* Input Wrapper */
.input-wrapper {
    position: relative;
    margin-bottom: 32px;
}

.google-input {
    width: 100%;
    height: 56px;
    padding: 13px 15px;
    font-size: 16px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.15s;
    background-color: #fff;
    font-family: 'Roboto', Arial, sans-serif;
}

.google-input:hover {
    border-color: #202124;
}

.google-input:focus {
    border-color: #1a73e8;
    border-width: 2px;
    padding: 12px 14px;
}

.google-input:focus + .google-label,
.google-input:not(:placeholder-shown) + .google-label,
.google-input.has-value + .google-label {
    top: -7px;
    left: 10px;
    font-size: 12px;
    color: #1a73e8;
    background-color: #fff;
    padding: 0 8px;
    font-weight: 400;
}

.google-label {
    position: absolute;
    top: 17px;
    left: 16px;
    font-size: 16px;
    color: #5f6368;
    pointer-events: none;
    transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
    font-weight: 400;
    letter-spacing: 0.00625em;
    font-family: 'Roboto', Arial, sans-serif;
}

/* Show Password Button */
.show-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.show-password:hover {
    background-color: rgba(60,64,67,0.08);
    border-radius: 50%;
}

.show-password svg {
    fill: currentColor;
}

/* Checkbox Container */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 32px;
}

.google-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label {
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    user-select: none;
    font-family: 'Roboto', Arial, sans-serif;
}

/* Password Form Specific */
.password-form .input-wrapper {
    margin-bottom: 8px;
}

.password-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

.forgot-password-link {
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    letter-spacing: 0.25px;
    padding: 8px 0;
}

.forgot-password-link:hover {
    text-decoration: underline;
}

/* Error Messages */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 0;
    color: #d93025;
    font-size: 12px;
    line-height: 16px;
    font-family: 'Roboto', Arial, sans-serif;
    letter-spacing: 0.3px;
}

.error-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: #d93025;
    margin-top: -1px;
}

.google-input.error {
    border-color: #d93025;
}

.google-input.error:focus {
    border-color: #d93025;
    border-width: 2px;
}

.google-input.error:hover {
    border-color: #d93025;
}

.google-label.error {
    color: #d93025;
}

.input-wrapper.has-error {
    margin-bottom: 8px;
}

/* Links */
.forgot-email,
.forgot-password,
.resend-code,
.other-options {
    margin: 32px 0 0;
}

.forgot-email a,
.forgot-password a,
.resend-code a,
.other-options a,
.try-another-way {
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    letter-spacing: 0.25px;
    display: inline-block;
    padding: 4px 0;
}

.forgot-email a:hover,
.forgot-password a:hover,
.resend-code a:hover,
.other-options a:hover,
.try-another-way:hover {
    background-color: rgba(26,115,232,0.04);
    border-radius: 4px;
    padding: 4px 8px;
    margin: 0 -8px;
}

/* Guest Mode */
.guest-mode {
    font-size: 14px;
    color: #5f6368;
    margin: 48px 0 32px;
    line-height: 20px;
    font-family: 'Roboto', Arial, sans-serif;
    letter-spacing: 0.2px;
}

.guest-mode a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.guest-mode a:hover {
    text-decoration: underline;
}

/* Button Group */
.button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.create-account {
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 9px 8px;
}

.create-account:hover {
    background-color: rgba(26,115,232,0.04);
    border-radius: 4px;
}

.next-button {
    background-color: #1a73e8;
    color: #fff;
    border: none;
    padding: 0 24px;
    height: 36px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    letter-spacing: 0.0107142857em;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.28s cubic-bezier(0.4,0,0.2,1), box-shadow 0.28s cubic-bezier(0.4,0,0.2,1);
    min-width: 88px;
    text-align: center;
    line-height: 36px;
}

.next-button:hover {
    background-color: #2b7de9;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}

.next-button:active {
    background-color: #5094ed;
    box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
}

.next-button:focus {
    outline: none;
    background-color: #5094ed;
}

/* 2FA Common Styles */
.account-chip-small {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 16px 0 32px;
    font-size: 14px;
    color: #5f6368;
}

.account-icon-small {
    width: 16px;
    height: 16px;
}

.user-email-small {
    font-family: 'Roboto', Arial, sans-serif;
    letter-spacing: 0.25px;
}

.verification-content {
    margin-top: 24px;
}

.verification-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

/* Phone Prompt (PIN) Styles */
.phone-prompt-container {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    padding: 24px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.phone-icon svg {
    width: 48px;
    height: 48px;
}

.prompt-text {
    flex: 1;
}

.prompt-title {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 8px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
}

.prompt-description {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 4px;
}

.device-name {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
}

.pin-section {
    text-align: center;
    margin: 32px 0;
}

.pin-label {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 16px;
}

.pin-display {
    display: inline-block;
    padding: 16px 32px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dadce0;
}

.pin-number {
    font-size: 28px;
    font-weight: 500;
    color: #202124;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
}

/* SMS and Auth Header */
.sms-header,
.auth-header {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.sms-icon svg,
.auth-icon svg {
    width: 48px;
    height: 48px;
}

.sms-text,
.auth-text {
    flex: 1;
}

.sms-title,
.auth-title {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 8px;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
}

.sms-description,
.auth-description {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 4px;
}

.phone-number {
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    margin-top: 4px;
}

.code-input {
    text-align: center;
    font-size: 18px;
    letter-spacing: 2px;
    font-family: 'Roboto', Arial, sans-serif;
}

.code-help {
    font-size: 14px;
    color: #5f6368;
    margin: 24px 0;
    text-align: center;
}

.code-help p {
    margin: 0;
    line-height: 20px;
}

.verification-actions {
    text-align: center;
    margin: 24px 0;
}

.resend-link {
    color: #1a73e8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    letter-spacing: 0.25px;
}

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

.auth-help-section {
    margin: 24px 0;
}

.help-details {
    border: none;
    background: none;
    padding: 0;
}

.help-summary {
    color: #1a73e8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
    letter-spacing: 0.25px;
    list-style: none;
    outline: none;
    position: relative;
    padding-right: 20px;
}

.help-summary::-webkit-details-marker {
    display: none;
}

.help-summary::after {
    content: '▼';
    position: absolute;
    right: 0;
    transform: rotate(-90deg);
    transition: transform 0.2s;
}

details[open] .help-summary::after {
    transform: rotate(0deg);
}

.help-content {
    margin-top: 16px;
    padding-left: 0;
}

.help-content p {
    font-size: 14px;
    color: #5f6368;
    margin: 8px 0;
    line-height: 20px;
}

.help-content p:first-child {
    margin-top: 0;
}

.google-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dadce0;
    padding: 16px 40px;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 448px;
    margin: 0 auto;
}

.language-selector {
    background: none;
    border: none;
    color: #5f6368;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
}

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

.footer-links a {
    color: #5f6368;
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: #202124;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 24px 20px;
    }
    
    .signin-card {
        padding: 24px 20px;
        border: none;
        box-shadow: none;
    }
    
    .button-group {
        flex-direction: column;
        gap: 16px;
    }
    
    .create-account {
        order: 2;
    }
    
    .next-button {
        order: 1;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}