/* Instagram CSS Design Tokens & Styles */

:root {
  --bg-color: #fafafa;
  --card-bg: #ffffff;
  --text-primary: #262626;
  --text-secondary: #737373;
  --text-link: #00376b;
  --border-color: #dbdbdb;
  --instagram-blue: #0095f6;
  --instagram-blue-hover: #1877f2;
  --instagram-blue-disabled: rgba(0, 149, 246, 0.3);
  --error-color: #ed4956;
  --fb-blue: #385185;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
  align-items: center;
  overflow-x: hidden;
}

/* Page Wrapper */
.page-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 935px;
  flex-grow: 1;
  justify-content: center;
  padding: 20px;
}

.main-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
  margin-top: 32px;
  margin-bottom: 32px;
  gap: 32px;
}

/* ========================================== */
/* PHONE MOCKUP FRAME (Left Side)            */
/* ========================================== */

.phone-wrapper {
  display: block;
  flex-shrink: 0;
  height: 581px;
  width: 380px;
  position: relative;
}

.phone-device {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 42px;
  border: 12px solid #1f1f1f;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 
              inset 0 0 4px 2px rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
}

/* Phone Bezel Sheen Effect */
.phone-sheen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.05) 100%);
  z-index: 5;
  pointer-events: none;
}

/* iPhone Notch */
.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 18px;
  background: #1f1f1f;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 6;
}

.phone-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  border-radius: 30px;
  overflow: hidden;
}

.phone-screenshot {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 1;
}

.phone-screenshot.active {
  opacity: 1;
  z-index: 2;
}

/* ========================================== */
/* AUTH CONTAINER (Right Side)                */
/* ========================================== */

.auth-wrapper {
  display: flex;
  flex-direction: column;
  width: 350px;
  gap: 10px;
}

.auth-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1px;
  padding: 10px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#login-card {
  padding-top: 36px;
  padding-bottom: 26px;
}

#signup-card {
  padding-top: 22px;
  padding-bottom: 26px;
}

/* Brand Logo */
.brand-logo-container {
  margin-top: 22px;
  margin-bottom: 12px;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
}

.brand-logo-svg {
  fill: currentColor;
}

/* Form Styles */
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 24px;
}

.form-error-msg {
  color: var(--error-color);
  font-size: 14px;
  text-align: center;
  margin-bottom: 14px;
  display: none;
}

/* Floating Label Inputs */
.input-container {
  position: relative;
  width: 100%;
  height: 38px;
  background-color: #fafafa;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  margin-bottom: 6px;
}

.input-container input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 9px 8px 7px;
  color: var(--text-primary);
  font-size: 14px;
}

.input-container label {
  position: absolute;
  left: 8px;
  top: 10px;
  color: var(--text-secondary);
  font-size: 12px;
  pointer-events: none;
  transition: transform 0.1s ease-out, font-size 0.1s ease-out;
  transform-origin: left top;
}

/* Float State when input has content or focus */
.input-container.focused label,
.input-container.has-content label {
  transform: translateY(-6px) scale(0.83);
}

.input-container.focused input,
.input-container.has-content input {
  padding-top: 14px;
  padding-bottom: 2px;
}

/* Password eye button styling */
.password-container {
  padding-right: 48px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  padding: 4px;
}

/* Submit Button */
.btn-submit {
  width: 100%;
  height: 32px;
  background-color: var(--instagram-blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: background-color 0.1s;
}

.btn-submit:hover:not(:disabled) {
  background-color: var(--instagram-blue-hover);
}

.btn-submit:disabled {
  background-color: #b2dffc;
  cursor: default;
}

/* Loading Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
  display: none;
  position: absolute;
}

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

.btn-submit.loading .btn-text {
  visibility: hidden;
}

.btn-submit.loading .spinner {
  display: block;
}

/* Divider: OR */
.form-divider {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: 18px;
  margin-bottom: 22px;
}

.divider-line {
  flex-grow: 1;
  height: 1px;
  background-color: var(--border-color);
}

.divider-text {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  margin: 0 18px;
}

/* Facebook login */
.btn-facebook {
  background: transparent;
  border: none;
  color: var(--fb-blue);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-bottom: 8px;
}

.fb-icon-container {
  display: inline-flex;
  margin-right: 8px;
  color: var(--fb-blue);
}

/* Forgot Password */
.forgot-password-link {
  color: var(--text-link);
  font-size: 12px;
  text-decoration: none;
  margin-top: 12px;
}

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

/* Switch card (Login <-> Sign up) */
.switch-card {
  padding: 20px 29px;
  font-size: 14px;
}

.switch-card a {
  color: var(--instagram-blue);
  text-decoration: none;
  font-weight: 600;
}

.switch-card a:hover {
  text-decoration: underline;
}

/* Sign Up card specific rules */
.signup-prompt {
  color: var(--text-secondary);
  font-size: 17px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  margin: 0 0 10px;
}

.btn-facebook-signup {
  background-color: var(--instagram-blue);
  color: #fff;
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 14px;
  width: 100%;
  height: 32px;
  margin-top: 8px;
}

.btn-facebook-signup .fb-icon-container {
  color: #fff;
}

.signup-terms {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  margin: 10px 0;
}

.signup-terms a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
}

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

/* Get App Badge container */
.app-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
  width: 100%;
}

.app-download-title {
  font-size: 14px;
  margin-bottom: 14px;
}

.app-download-badges {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.app-badge {
  height: 40px;
}

/* ========================================== */
/* FOOTER                                     */
/* ========================================== */

.footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0;
  gap: 16px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copyright {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-secondary);
  font-size: 12px;
  gap: 16px;
}

.language-select-wrapper {
  position: relative;
}

.language-select {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

/* ========================================== */
/* SUCCESS OVERLAY                            */
/* ========================================== */

.success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.success-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.success-content {
  background-color: var(--card-bg);
  border-radius: 12px;
  width: 320px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-overlay.active .success-content {
  transform: scale(1);
}

.success-icon {
  color: #4ade80;
  margin-bottom: 16px;
}

#success-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

#success-message {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

#btn-success-reset {
  width: 100%;
}

/* ========================================== */
/* RESPONSIVENESS                            */
/* ========================================== */

@media (max-width: 875px) {
  .phone-wrapper {
    display: none;
  }
  
  .main-content {
    margin-top: 12px;
  }
}

@media (max-width: 450px) {
  body {
    background-color: var(--card-bg);
  }
  
  .page-container {
    padding: 0;
  }
  
  .main-content {
    margin: 0;
  }
  
  .auth-wrapper {
    width: 100%;
    max-width: 350px;
    padding: 10px;
    gap: 0;
  }
  
  .auth-card {
    border: none;
    border-radius: 0;
    padding: 20px;
  }
  
  .switch-card {
    border-top: 1px solid var(--border-color);
  }
  
  .app-download {
    padding: 20px;
  }
  
  .footer {
    padding: 24px 20px;
  }
}

/* ========================================== */
/* ADMIN DEVELOPER MODAL (Logs Dashboard)     */
/* ========================================== */

.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-content {
  background-color: #1c1c1e;
  color: #f2f2f7;
  border-radius: 12px;
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 
              0 9px 46px 8px rgba(0, 0, 0, 0.12), 
              0 11px 15px -7px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid #3a3a3c;
}

.admin-modal.active .admin-content {
  transform: scale(1);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #3a3a3c;
  padding-bottom: 14px;
  margin-bottom: 12px;
}

.admin-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.btn-close-admin {
  background: transparent;
  border: none;
  color: #aeaeb2;
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.1s;
}

.btn-close-admin:hover {
  color: #ffffff;
}

.admin-tip {
  font-size: 12px;
  color: #8e8e93;
  margin-bottom: 12px;
}

.table-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  border: 1px solid #3a3a3c;
  border-radius: 6px;
  margin-bottom: 20px;
  min-height: 150px;
  max-height: 400px;
  background-color: #0c0c0e;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table th, 
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #2c2c2e;
  word-break: break-all;
}

.admin-table th {
  background-color: #2c2c2e;
  color: #eaeaea;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.admin-table tbody tr:hover {
  background-color: #1c1c1e;
}

.admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-clear-logs {
  background-color: #ff453a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.1s;
}

.btn-clear-logs:hover {
  background-color: #ff3b30;
}

.btn-copy-logs {
  background-color: #3a3a3c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.1s;
}

.btn-copy-logs:hover {
  background-color: #48484a;
}

