
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Fixed Login Button */
.cognito-auth-button {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
}

.cognito-auth-button button {
    padding: 8px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cognito-auth-button button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Modal Container */
.cognito-login-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

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

/* Modal Content */
.cognito-login-modal-content {
    background: white;
    margin: 5% auto;
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    padding: 32px;
    animation: slideUp 0.4s ease;
}

/* Notification Messages - Hidden by default */
.notification-error,
.notification-success {
    display: none;
    padding: 12px 16px;
    margin: -32px -32px 20px -32px;
    font-size: 14px;
}

.notification-error {
    background: #fee2e2;
    color: #dc2626;
}

.notification-success {
    background: #dcfce7;
    color: #16a34a;
}

/* Close Button */
.cognito-close {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 20px;
    height: 20px;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 24px;
    line-height: 20px;
    text-align: center;
    color: #666;
}

.cognito-close:hover {
    opacity: 1;
}

/* Tab Navigation */
.cognito-tab-buttons {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.cognito-tab-button {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.cognito-tab-button.active {
    color: #007bff;
}

.cognito-tab-button.active:after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #007bff;
}

/* Form Elements */
.cognito-login-form input,
.cognito-signup-form input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.cognito-login-form input:focus,
.cognito-signup-form input:focus {
    border-color: #007bff;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Submit Button */
.cognito-login-form button,
.cognito-signup-form button {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.cognito-login-form button:hover,
.cognito-signup-form button:hover {
    background: #0056b3;
}

/* Social Login Button */
.cognito-social-login button {
    width: 100%;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.cognito-social-login button:hover {
    background: #f8fafc;
}

.cognito-social-login img {
    width: 18px;
    height: 18px;
}

/* Forgot Password Link */
.cognito-forgot-password {
    text-align: right;
    margin-top: 12px;
}

.cognito-forgot-password a {
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
}

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

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .cognito-login-modal-content {
        margin: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .cognito-tab-buttons {
        margin-top: 16px;
    }
}

/* Accessibility Focus States */
button:focus-visible,
input:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Password Reset Forms */
.cognito-forgot-password-form,
.cognito-reset-password-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.cognito-forgot-password-form h3,
.cognito-reset-password-form h3 {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 24px;
}

.cognito-forgot-password-form input,
.cognito-reset-password-form input {
    width: 100%;
    padding: 12px 16px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.cognito-forgot-password-form input:focus,
.cognito-reset-password-form input:focus {
    border-color: #007bff;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#cognito-forgot-password-button,
#cognito-reset-password-button {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

#cognito-forgot-password-button:hover,
#cognito-reset-password-button:hover {
    background: #0056b3;
}

/* Back Button for Reset Forms */
.cognito-back-button {
    display: inline-block;
    padding: 8px 0;
    color: #64748b;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s ease;
    margin-top: 16px;
    text-align: center;
    width: 100%;
}

.cognito-back-button:hover {
    color: #0056b3;
}

/* Space between inputs */
#cognito-reset-code {
    margin-bottom: 16px;
}

/* Show active form */
.cognito-forgot-password-form.active,
.cognito-reset-password-form.active {
    display: block;
}

/* Hide other forms when password reset is active */
.cognito-forgot-password-form.active ~ .cognito-login-form,
.cognito-reset-password-form.active ~ .cognito-login-form,
.cognito-forgot-password-form.active ~ .cognito-signup-form,
.cognito-reset-password-form.active ~ .cognito-signup-form {
    display: none;
}

/* Add some space after the form title */
.cognito-forgot-password-form h3,
.cognito-reset-password-form h3 {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

/* Optional: Add a subtle info text */
.password-reset-info {
    font-size: 13px;
    color: #64748b;
    margin: 8px 0 16px;
    line-height: 1.5;
}

/* Modal adjustments for reset forms */
.cognito-login-modal-content.reset-active {
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 640px) {
    .cognito-forgot-password-form,
    .cognito-reset-password-form {
        padding: 20px;
    }
    
    .cognito-forgot-password-form h3,
    .cognito-reset-password-form h3 {
        font-size: 16px;
        margin-bottom: 20px;
    }
}

#cognito-verification-form {
    padding: 32px;
    background: white;
    border-radius: 16px;
    max-width: 420px;
    margin: 0 auto;
}

#cognito-verification-form h3 {
    font-size: 18px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 24px;
    text-align: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

#cognito-verification-code {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 18px;
    letter-spacing: 0.3em;
    text-align: center;
    transition: all 0.2s ease;
    background: #f8fafc;
    margin-bottom: 20px;
}

#cognito-verification-code:focus {
    border-color: #007bff;
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#cognito-verification-code::placeholder {
    color: #94a3b8;
    letter-spacing: normal;
}

#cognito-verify-button {
    width: 100%;
    padding: 14px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

#cognito-verify-button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

#cognito-verify-button:active {
    transform: translateY(0);
}

#cognito-resend-code-button {
    width: 100%;
    padding: 14px;
    background: white;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#cognito-resend-code-button:hover {
    background: #f8fafc;
    color: #007bff;
    border-color: #007bff;
}

/* モバイル対応 */
@media (max-width: 640px) {
    #cognito-verification-form {
        padding: 24px;
        border-radius: 0;
        max-width: none;
        height: 100%;
    }

    #cognito-verification-form h3 {
        font-size: 16px;
        margin-bottom: 20px;
    }

    #cognito-verification-code {
        font-size: 16px;
        padding: 12px;
    }

    #cognito-verify-button,
    #cognito-resend-code-button {
        padding: 12px;
    }
}

/* アニメーション */
@keyframes formAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#cognito-verification-form {
    animation: formAppear 0.3s ease-out;
}

/* Profile Container */
#cognito-profile-container {
    display: none;
    position: fixed;
    top: 24px;
    right: 24px;
    cursor: pointer;
    text-align: center;
    z-index: 1000;
    transition: all 0.2s ease;
}

/* Profile Image */
#cognito-profile-image {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

#cognito-profile-image:hover {
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Profile Details Dropdown */
#cognito-profile-details {
    display: none;
    background-color: white;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    position: absolute;
    top: 84px;
    right: 0;
    min-width: 200px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    animation: dropdownAppear 0.2s ease;
}

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

/* Username Display */
#cognito-username-display {
    margin-bottom: 16px;
    font-weight: 500;
    color: #1a1a1a;
    font-size: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* Logout Button */
#cognito-logout-button {
    width: 100%;
    padding: 10px 16px;
    background-color: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#cognito-logout-button:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

#cognito-logout-button:active {
    transform: translateY(0);
}

/* Profile Container Show/Hide Animation */
#cognito-profile-container.visible {
    display: block;
    animation: profileAppear 0.3s ease;
}

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

/* Dropdown Show Animation */
#cognito-profile-details.visible {
    display: block;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    #cognito-profile-container {
        top: 16px;
        right: 16px;
    }

    #cognito-profile-image {
        width: 56px;
        height: 56px;
    }

    #cognito-profile-details {
        top: 68px;
        right: 0;
        width: auto;
        min-width: 180px;
        padding: 12px;
    }

    #cognito-username-display {
        font-size: 14px;
        margin-bottom: 12px;
    }

    #cognito-logout-button {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Accessibility */
#cognito-profile-container:focus-visible,
#cognito-logout-button:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.cognito-logout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(17, 24, 39, 0.85), rgba(17, 24, 39, 0.95));
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cognito-logout-modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    min-width: 360px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
    transform-origin: center;
    animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cognito-logout-button-container {
    margin-top: 28px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.cognito-logout-yes-button {
    padding: 12px 28px;
    background: linear-gradient(to bottom, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 4px rgba(220, 38, 38, 0.2),
        0 0 0 1px rgba(220, 38, 38, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.cognito-logout-yes-button:hover {
    background: linear-gradient(to bottom, #dc2626, #b91c1c);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(220, 38, 38, 0.3),
        0 0 0 1px rgba(220, 38, 38, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.cognito-logout-no-button {
    padding: 12px 28px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    color: #64748b;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cognito-logout-no-button:hover {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.cognito-logout-modal.show {
    display: flex;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

@keyframes modalPop {
    0% { 
        transform: scale(0.95);
        opacity: 0;
    }
    50% {
        transform: scale(1.02);
    }
    100% { 
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .cognito-logout-modal-content {
        margin: 0 20px;
        min-width: auto;
        width: 100%;
        max-width: 360px;
    }
}

#cognito-displayname-display {
    font-size: 1.2em;
    color: #333;
}

#cognito-username-display {
    font-size: 0.9em;
    color: #777;
}

#cognito-settings-button {
    width: 100%;
    padding: 10px 16px;
    background: white;
    color: #1a1a1a;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
 }
 
 #cognito-settings-button:hover {
    background: #f8fafc;
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 }
 
 #cognito-settings-button:active {
    transform: translateY(0);
 }
 
 @media (max-width: 640px) {
    #cognito-settings-button {
        padding: 8px 12px;
        font-size: 13px;
        margin-bottom: 8px;
    }
 }